mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	Implemented "CQ DX " by disguising it as callsign "CQ9DX ".
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2791 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									4d19d9dd5b
								
							
						
					
					
						commit
						aeb9cf2618
					
				@ -1,4 +1,4 @@
 | 
				
			|||||||
subroutine genjt9(msg0,msgsent,i4tone)
 | 
					subroutine genjt9(msg0,ichk,msgsent,i4tone,itext)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
! Encodes a JT9 message and returns msgsent, the message as it will
 | 
					! Encodes a JT9 message and returns msgsent, the message as it will
 | 
				
			||||||
! be decoded, and an integer array i4tone(85) of 9-FSK tone values 
 | 
					! be decoded, and an integer array i4tone(85) of 9-FSK tone values 
 | 
				
			||||||
@ -32,12 +32,10 @@ subroutine genjt9(msg0,msgsent,i4tone)
 | 
				
			|||||||
  enddo
 | 
					  enddo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  call packmsg(message,i4Msg6BitWords,text)   !Pack message into 12 6-bit bytes
 | 
					  call packmsg(message,i4Msg6BitWords,text)   !Pack message into 12 6-bit bytes
 | 
				
			||||||
 | 
					  itext=0
 | 
				
			||||||
 | 
					  if(text) itext=1
 | 
				
			||||||
  call unpackmsg(i4Msg6BitWords,msgsent)      !Unpack to get msgsent
 | 
					  call unpackmsg(i4Msg6BitWords,msgsent)      !Unpack to get msgsent
 | 
				
			||||||
  if(i4tone(1).eq.-99) then
 | 
					  if(ichk.ne.0) go to 999
 | 
				
			||||||
     i4tone(2)=0
 | 
					 | 
				
			||||||
     if(text) i4tone(2)=1
 | 
					 | 
				
			||||||
     go to 999
 | 
					 | 
				
			||||||
  endif
 | 
					 | 
				
			||||||
  call entail(i4Msg6BitWords,i1Msg8BitBytes)  !Add tail, convert to 8-bit bytes
 | 
					  call entail(i4Msg6BitWords,i1Msg8BitBytes)  !Add tail, convert to 8-bit bytes
 | 
				
			||||||
  nsym2=206
 | 
					  nsym2=206
 | 
				
			||||||
  call encode232(i1Msg8BitBytes,nsym2,i1EncodedBits)   !Encode K=32, r=1/2
 | 
					  call encode232(i1Msg8BitBytes,nsym2,i1EncodedBits)   !Encode K=32, r=1/2
 | 
				
			||||||
 | 
				
			|||||||
@ -26,10 +26,14 @@ program jt9code
 | 
				
			|||||||
  write(*,1000) msg0
 | 
					  write(*,1000) msg0
 | 
				
			||||||
1000 format('Message:',3x,a22)
 | 
					1000 format('Message:',3x,a22)
 | 
				
			||||||
  msg=msg0
 | 
					  msg=msg0
 | 
				
			||||||
  call genjt9(msg,decoded,i4tone)               !Encode message into tone #s
 | 
					  ichk=0
 | 
				
			||||||
 | 
					  itext=0
 | 
				
			||||||
 | 
					  call genjt9(msg,ichk,decoded,i4tone,itext)       !Encode message into tone #s
 | 
				
			||||||
  write(*,1002) i4tone
 | 
					  write(*,1002) i4tone
 | 
				
			||||||
1002 format('Channel symbols:'/(30i2))
 | 
					1002 format('Channel symbols:'/(30i2))
 | 
				
			||||||
  write(*,1004) decoded
 | 
					  if(itext.eq.0) write(*,1004) decoded
 | 
				
			||||||
1004 format('Decoded message:',1x,a22)
 | 
					1004 format('Decoded message:',1x,a22)
 | 
				
			||||||
 | 
					  if(itext.ne.0) write(*,1005) decoded
 | 
				
			||||||
 | 
					1005 format('Decoded message:',1x,a22,3x,'(free text)')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
999 end program jt9code
 | 
					999 end program jt9code
 | 
				
			||||||
 | 
				
			|||||||
@ -24,8 +24,10 @@ subroutine packmsg(msg,dat,text)
 | 
				
			|||||||
     iz=iz-1
 | 
					     iz=iz-1
 | 
				
			||||||
  enddo
 | 
					  enddo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					5 if(msg(1:6).eq.'CQ DX ') msg(3:3)='9'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
! See if it's a CQ message
 | 
					! See if it's a CQ message
 | 
				
			||||||
5 if(msg(1:3).eq.'CQ ') then
 | 
					  if(msg(1:3).eq.'CQ ') then
 | 
				
			||||||
     i=3
 | 
					     i=3
 | 
				
			||||||
! ... and if so, does it have a reply frequency?
 | 
					! ... and if so, does it have a reply frequency?
 | 
				
			||||||
     if(msg(4:4).ge.'0' .and. msg(4:4).le.'9' .and.                  &
 | 
					     if(msg(4:4).ge.'0' .and. msg(4:4).le.'9' .and.                  &
 | 
				
			||||||
 | 
				
			|||||||
@ -96,5 +96,8 @@ subroutine unpackmsg(dat,msg)
 | 
				
			|||||||
     msg(j:j)=' '
 | 
					     msg(j:j)=' '
 | 
				
			||||||
  endif
 | 
					  endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
100 return
 | 
					100 continue
 | 
				
			||||||
 | 
					  if(msg(1:6).eq.'CQ9DX ') msg(3:3)=' '
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return
 | 
				
			||||||
end subroutine unpackmsg
 | 
					end subroutine unpackmsg
 | 
				
			||||||
 | 
				
			|||||||
@ -1061,7 +1061,8 @@ void MainWindow::guiUpdate()
 | 
				
			|||||||
    ba2msg(ba,message);
 | 
					    ba2msg(ba,message);
 | 
				
			||||||
//    ba2msg(ba,msgsent);
 | 
					//    ba2msg(ba,msgsent);
 | 
				
			||||||
    int len1=22;
 | 
					    int len1=22;
 | 
				
			||||||
    genjt9_(message,msgsent,itone,len1,len1);
 | 
					    int ichk=0,itext=0;
 | 
				
			||||||
 | 
					    genjt9_(message,&ichk,msgsent,itone,&itext,len1,len1);
 | 
				
			||||||
    msgsent[22]=0;
 | 
					    msgsent[22]=0;
 | 
				
			||||||
    lab5->setText("Last Tx:  " + QString::fromAscii(msgsent));
 | 
					    lab5->setText("Last Tx:  " + QString::fromAscii(msgsent));
 | 
				
			||||||
    if(m_restart) {
 | 
					    if(m_restart) {
 | 
				
			||||||
@ -1457,14 +1458,15 @@ void MainWindow::msgtype(QString t, QLineEdit* tx)               //msgtype()
 | 
				
			|||||||
  char msgsent[23];
 | 
					  char msgsent[23];
 | 
				
			||||||
  int len1=22;
 | 
					  int len1=22;
 | 
				
			||||||
  int jtone[85];
 | 
					  int jtone[85];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  t=t.toUpper();
 | 
					  t=t.toUpper();
 | 
				
			||||||
  QByteArray s=t.toUpper().toLocal8Bit();
 | 
					  QByteArray s=t.toUpper().toLocal8Bit();
 | 
				
			||||||
  ba2msg(s,message);
 | 
					  ba2msg(s,message);
 | 
				
			||||||
  jtone[0]=-99;
 | 
					  int ichk=1,itext=0;
 | 
				
			||||||
  genjt9_(message,msgsent,jtone,len1,len1);
 | 
					  genjt9_(message,&ichk,msgsent,itone,&itext,len1,len1);
 | 
				
			||||||
  msgsent[22]=0;
 | 
					  msgsent[22]=0;
 | 
				
			||||||
  bool text=false;
 | 
					  bool text=false;
 | 
				
			||||||
  if(jtone[1]==1) text=true;
 | 
					  if(itext!=0) text=true;
 | 
				
			||||||
  QString t1;
 | 
					  QString t1;
 | 
				
			||||||
  t1.fromAscii(msgsent);
 | 
					  t1.fromAscii(msgsent);
 | 
				
			||||||
  if(text) t1=t1.mid(0,13);
 | 
					  if(text) t1=t1.mid(0,13);
 | 
				
			||||||
 | 
				
			|||||||
@ -233,7 +233,8 @@ void symspec_(int* k, int* ntrperiod, int* nsps, int* ingain, int* nb,
 | 
				
			|||||||
              float* df3, int* nhsym, int* nzap, float* slimit,
 | 
					              float* df3, int* nhsym, int* nzap, float* slimit,
 | 
				
			||||||
              uchar lstrong[], int* npts8);
 | 
					              uchar lstrong[], int* npts8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void genjt9_(char* msg, char* msgsent, int itone[], int len1, int len2);
 | 
					void genjt9_(char* msg, int* ichk, char* msgsent, int itone[],
 | 
				
			||||||
 | 
					             int* itext, int len1, int len2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//void decoder_(int* ntrperiod, int* ndepth, int* mRxLog, float c0[]);
 | 
					//void decoder_(int* ntrperiod, int* ndepth, int* mRxLog, float c0[]);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user