From 53bf3f4de125d211d215a7e94da8a092a9790125 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Thu, 16 Feb 2023 09:00:29 -0600 Subject: [PATCH 1/4] New command-line program hash22calc will print the 22-bit hash value of a valid callsign. --- lib/77bit/hash22calc.f90 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/77bit/hash22calc.f90 diff --git a/lib/77bit/hash22calc.f90 b/lib/77bit/hash22calc.f90 new file mode 100644 index 000000000..fbebeb512 --- /dev/null +++ b/lib/77bit/hash22calc.f90 @@ -0,0 +1,40 @@ +program hash22calc +! Given a valid callsign, calculate and print its 22-bit hash. + + use packjt77 + + character*13 callsign + character*1 c + character*6 basecall + logical cok + + nargs=iargc() + if(nargs.ne.1) then + print*,'Given a valid callsign, print its 22-bit hash.' + print*,'Usage: hashcalc ' + go to 999 + endif + call getarg(1,callsign) + +! convert to upper case + ilen=len(trim(callsign)) + do i=1, ilen + c=callsign(i:i) + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) !Force upper case + callsign(i:i)=c + enddo + +! check for a valid callsign + call chkcall(callsign,basecall,cok) + if(.not.cok) then + print*,'Invalid callsign' + goto 999 + endif + +! calculate the hash + n22 = ihashcall(callsign,22) + write(*,'(a,i7.7)') callsign,n22 + +999 end program hash22calc + +include '../chkcall.f90' From 4416c21f1b0e840b3c4d78e67a095a681ee00e96 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Thu, 16 Feb 2023 09:01:23 -0600 Subject: [PATCH 2/4] Build and install hash22calc. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86bc970c6..807aacd20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1172,6 +1172,9 @@ 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}) From cd14778f0db20991a53e5cba53c1b851b2b3aefb Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Thu, 16 Feb 2023 09:11:07 -0600 Subject: [PATCH 3/4] Minor to hash22calc.f90 --- lib/77bit/hash22calc.f90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/77bit/hash22calc.f90 b/lib/77bit/hash22calc.f90 index fbebeb512..500e1eea1 100644 --- a/lib/77bit/hash22calc.f90 +++ b/lib/77bit/hash22calc.f90 @@ -11,7 +11,8 @@ program hash22calc nargs=iargc() if(nargs.ne.1) then print*,'Given a valid callsign, print its 22-bit hash.' - print*,'Usage: hashcalc ' + print*,'Usage: hash22calc ' + print*,' e.g. hash22calc W9ABC' go to 999 endif call getarg(1,callsign) @@ -27,8 +28,9 @@ program hash22calc ! check for a valid callsign call chkcall(callsign,basecall,cok) if(.not.cok) then - print*,'Invalid callsign' - goto 999 + print*,'Invalid callsign' + print*,'Usage: hash22calc ' + goto 999 endif ! calculate the hash From 280dd373d3d71bf52d8ff516e5f1700ee516ed86 Mon Sep 17 00:00:00 2001 From: Uwe Risse Date: Thu, 16 Feb 2023 20:06:03 +0100 Subject: [PATCH 4/4] Allow "CQ with individual contest name" also when the contest name field is empty. --- widgets/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 78d717fb9..845441c0a 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -5771,7 +5771,7 @@ void MainWindow::genCQMsg () ( tlist.at(1)==my_callsign or tlist.at(2)==my_callsign ) and stdCall(my_callsign)) { - if(m_config.Individual_Contest_Name() && m_config.Contest_Name() != "") { + if(m_config.Individual_Contest_Name()) { m_cqStr = m_config.Contest_Name(); } else { if(SpecOp::NA_VHF == m_specOp) m_cqStr="TEST";