mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-02-03 09:44:24 -05:00
Fix a bug in handling message lengths.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2745 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
3540547084
commit
f347e3755a
@ -1,9 +1,10 @@
|
|||||||
subroutine genjt9(message,msgsent,i4tone)
|
subroutine genjt9(msg0,msgsent,i4tone)
|
||||||
|
|
||||||
! 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
|
||||||
! in the range 0-8.
|
! in the range 0-8.
|
||||||
|
|
||||||
|
character*22 msg0
|
||||||
character*22 message !Message to be generated
|
character*22 message !Message to be generated
|
||||||
character*22 msgsent !Message as it will be received
|
character*22 msgsent !Message as it will be received
|
||||||
integer*4 i4Msg6BitWords(13) !72-bit message as 6-bit words
|
integer*4 i4Msg6BitWords(13) !72-bit message as 6-bit words
|
||||||
@ -16,7 +17,15 @@ subroutine genjt9(message,msgsent,i4tone)
|
|||||||
include 'jt9sync.f90'
|
include 'jt9sync.f90'
|
||||||
save
|
save
|
||||||
|
|
||||||
|
message=msg0
|
||||||
do i=1,22
|
do i=1,22
|
||||||
|
if(ichar(message(i:i)).eq.0) then
|
||||||
|
message(i:)=' '
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
|
||||||
|
do i=1,22 !Omit leading blanks
|
||||||
if(message(1:1).ne.' ') exit
|
if(message(1:1).ne.' ') exit
|
||||||
message=message(i+1:)
|
message=message(i+1:)
|
||||||
enddo
|
enddo
|
||||||
|
@ -1051,15 +1051,19 @@ void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg()
|
|||||||
bool eom;
|
bool eom;
|
||||||
eom=false;
|
eom=false;
|
||||||
int iz=ba.length();
|
int iz=ba.length();
|
||||||
for(int i=0;i<iz; i++) {
|
// qDebug() << ba << iz;
|
||||||
if((int)ba[i] == 0) eom=true;
|
for(int i=0;i<iz+1; i++) {
|
||||||
|
if((int)ba[i] == 0) {
|
||||||
|
// qDebug() << i;
|
||||||
|
eom=true;
|
||||||
|
}
|
||||||
if(eom) {
|
if(eom) {
|
||||||
message[i]=32;
|
message[i]=32;
|
||||||
} else {
|
} else {
|
||||||
message[i]=ba[i];
|
message[i]=ba[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
message[28]=0;
|
message[iz]=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_txFirstCheckBox_stateChanged(int nstate) //TxFirst
|
void MainWindow::on_txFirstCheckBox_stateChanged(int nstate) //TxFirst
|
||||||
|
Loading…
Reference in New Issue
Block a user