mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-10-31 04:50:34 -04:00 
			
		
		
		
	Fix bug that prevented generation of MSK144 Sh messages with extended callsign. Change all MSK144 Sh code to use 12-char mycall and hiscall and 37-char messages. Hash full extended callsigns (not just base call) and print full callsigns, e.g. <KP4/K1JT K9AN> RRR
This commit is contained in:
		
							parent
							
								
									5aaa49d4ae
								
							
						
					
					
						commit
						dd9bdc6d1f
					
				| @ -29,7 +29,7 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype) | ||||
| 10 irpt=i                                   !Report index, 0-15 | ||||
|   if(ichk.lt.10000) then | ||||
|      hashmsg=msg(2:i1-1) | ||||
|      call hash(hashmsg,22,ihash)           | ||||
|      call hash(hashmsg,37,ihash)           | ||||
|      ihash=iand(ihash,4095)                 !12-bit hash  | ||||
|      ig=16*ihash + irpt                     !4-bit report  | ||||
|   else | ||||
|  | ||||
| @ -46,6 +46,7 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype) | ||||
|     enddo | ||||
|   endif | ||||
| 
 | ||||
|   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 | ||||
| @ -54,24 +55,29 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype) | ||||
| 2    i4tone(1)=nfreq | ||||
|   else | ||||
|      message=msg0 | ||||
| 
 | ||||
|      do i=1, 37 | ||||
|         if(ichar(message(i:i)).eq.0) then | ||||
|            message(i:)='                      ' | ||||
|            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 | ||||
|  | ||||
| @ -5,8 +5,8 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray,             & | ||||
| 
 | ||||
|   parameter (NSPM=240) | ||||
|   character*4 rpt(0:15) | ||||
|   character*6 mycall,hiscall,mycall0,hiscall0 | ||||
|   character*22 hashmsg,msgreceived | ||||
|   character*12 mycall,hiscall,mycall0,hiscall0 | ||||
|   character*37 hashmsg,msgreceived | ||||
|   complex cb(42) | ||||
|   complex cfac,cca | ||||
|   complex c(NSPM) | ||||
| @ -59,7 +59,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray,             & | ||||
|     hashmsg=trim(mycall)//' '//trim(hiscall) | ||||
|     if( hashmsg .ne. ' ' .and. hiscall .ne. ''  ) then ! protect against blank mycall/hiscall | ||||
|       call fmtmsg(hashmsg,iz) | ||||
|       call hash(hashmsg,22,ihash) | ||||
|       call hash(hashmsg,37,ihash) | ||||
|       ihash=iand(ihash,4095) | ||||
|     else | ||||
|       ihash=9999  ! so that it can never match a received hash | ||||
|  | ||||
| @ -6,8 +6,8 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray,   & | ||||
|   use timer_module, only: timer | ||||
| 
 | ||||
|   parameter (NSPM=240, MAXSTEPS=150, NFFT=NSPM, MAXCAND=5, NPATTERNS=6) | ||||
|   character*6 mycall,hiscall | ||||
|   character*22 msgreceived | ||||
|   character*12 mycall,hiscall | ||||
|   character*37 msgreceived | ||||
|   complex cbig(n) | ||||
|   complex cdat(3*NSPM)                    !Analytic signal | ||||
|   complex c(NSPM) | ||||
|  | ||||
| @ -15,7 +15,6 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall,   & | ||||
| 
 | ||||
|   character*4 decsym                 !"&" for mskspd or "^" for long averages | ||||
|   character*37 msgreceived           !Decoded message | ||||
|   character*22 msgrx22               !Sh messages are returned as 22chars | ||||
|   character*37 msglast,msglastswl    !Used for dupechecking | ||||
|   character*80 line                  !Formatted line with UTC dB T Freq Msg | ||||
|   character*12 mycall,hiscall | ||||
| @ -119,9 +118,8 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall,   & | ||||
|   call msk144spd(cdat,np,ntol,ndecodesuccess,msgreceived,fc,fest,tdec,navg,ct, & | ||||
|                  softbits) | ||||
|   if(ndecodesuccess.eq.0 .and. (bshmsg.or.bswl)) then | ||||
|      call msk40spd(cdat,np,ntol,mycall(1:6),hiscall(1:6),bswl,nhasharray,      & | ||||
|               ndecodesuccess,msgrx22,fc,fest,tdec,navg) | ||||
|      if( ndecodesuccess .ge. 1 ) msgreceived=msgrx22//'               ' | ||||
|      call msk40spd(cdat,np,ntol,mycall,hiscall,bswl,nhasharray,      & | ||||
|               ndecodesuccess,msgreceived,fc,fest,tdec,navg) | ||||
|   endif | ||||
|   if( ndecodesuccess .ge. 1 ) then | ||||
|     tdec=tsec+tdec | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| subroutine update_hasharray(nhasharray) | ||||
| 
 | ||||
|   use packjt77   | ||||
|   character*22 hashmsg | ||||
|   character*37 hashmsg | ||||
|   integer nhasharray(MAXRECENT,MAXRECENT) | ||||
| 
 | ||||
|   nhasharray=-1 | ||||
| @ -10,12 +10,12 @@ subroutine update_hasharray(nhasharray) | ||||
|       if( recent_calls(i)(1:1) .ne. ' ' .and. recent_calls(j)(1:1) .ne. ' ' ) then | ||||
|         hashmsg=trim(recent_calls(i))//' '//trim(recent_calls(j)) | ||||
|         call fmtmsg(hashmsg,iz) | ||||
|         call hash(hashmsg,22,ihash) | ||||
|         call hash(hashmsg,37,ihash) | ||||
|         ihash=iand(ihash,4095) | ||||
|         nhasharray(i,j)=ihash | ||||
|         hashmsg=trim(recent_calls(j))//' '//trim(recent_calls(i)) | ||||
|         call fmtmsg(hashmsg,iz) | ||||
|         call hash(hashmsg,22,ihash) | ||||
|         call hash(hashmsg,37,ihash) | ||||
|         ihash=iand(ihash,4095) | ||||
|         nhasharray(j,i)=ihash | ||||
|       endif | ||||
|  | ||||
| @ -1510,11 +1510,13 @@ void MainWindow::fastSink(qint64 frames) | ||||
|   int RxFreq=ui->RxFreqSpinBox->value (); | ||||
|   int nTRpDepth=m_TRperiod + 1000*(m_ndepth & 3); | ||||
|   qint64 ms0 = QDateTime::currentMSecsSinceEpoch(); | ||||
|   strncpy(dec_data.params.mycall, (m_baseCall+"            ").toLatin1(),12); | ||||
| //  strncpy(dec_data.params.mycall, (m_baseCall+"            ").toLatin1(),12);
 | ||||
|   strncpy(dec_data.params.mycall,(m_config.my_callsign () + "            ").toLatin1(),12); | ||||
|   QString hisCall {ui->dxCallEntry->text ()}; | ||||
|   bool bshmsg=ui->cbShMsgs->isChecked(); | ||||
|   bool bswl=ui->cbSWL->isChecked(); | ||||
|   strncpy(dec_data.params.hiscall,(Radio::base_callsign (hisCall) + "            ").toLatin1 ().constData (), 12); | ||||
| //  strncpy(dec_data.params.hiscall,(Radio::base_callsign (hisCall) + "            ").toLatin1 ().constData (), 12);
 | ||||
|   strncpy(dec_data.params.hiscall,(hisCall + "            ").toLatin1 ().constData (), 12); | ||||
|   strncpy(dec_data.params.mygrid, (m_config.my_grid()+"      ").toLatin1(),6); | ||||
|   QString dataDir; | ||||
|   dataDir = m_config.writeable_data_dir ().absolutePath (); | ||||
| @ -4708,6 +4710,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) | ||||
|       (!bMyCall or !bHisCall or m_config.bGenerate77()); | ||||
| 
 | ||||
|   QString t0=hisBase + " " + m_baseCall + " "; | ||||
|   QString t0s=hisCall + " " + my_callsign + " "; | ||||
|   QString t0a,t0b; | ||||
|   if(b77) { | ||||
|     if(bHisCall and bMyCall) t0=hisCall + " " + my_callsign + " "; | ||||
| @ -4763,8 +4766,8 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) | ||||
|     } | ||||
| 
 | ||||
|     if(m_mode=="MSK144" and m_bShMsgs) { | ||||
|       int i=t0.length()-1; | ||||
|       t0="<" + t0.mid(0,i) + "> "; | ||||
|       int i=t0s.length()-1; | ||||
|       t0="<" + t0s.mid(0,i) + "> "; | ||||
|       if(!m_config.bNA_VHF_Contest()) { | ||||
|         if(n<=-2) n=-3; | ||||
|         if(n>=-1 and n<=1) n=0; | ||||
| @ -4790,7 +4793,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) | ||||
|     } | ||||
| 
 | ||||
|     t=t0 + (m_send_RR73 ? "RR73" : "RRR"); | ||||
|     if(m_mode=="MSK144" or m_mode=="FT8") { | ||||
|     if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8") { | ||||
|       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"); | ||||
|     } | ||||
| @ -4798,7 +4801,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) | ||||
|     msgtype(t, ui->tx4); | ||||
| 
 | ||||
|     t=t0 + "73"; | ||||
|     if(m_mode=="MSK144" or m_mode=="FT8") { | ||||
|     if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8") { | ||||
|       if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> 73"; | ||||
|       if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " 73"; | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user