mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-22 12:08:43 -04:00
Rationalize NA contest mode
Generic message packing and unpacking routines now understand antipode grid contest messages. These messages are now recognized as standard messages in message response processing and dealt with appropriately when contest mode is selected and applicable (currently FT8 and MSK144 only). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8062 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
6c5809876a
commit
dd1362b69a
@ -556,6 +556,7 @@ set (wsjt_FSRCS
|
||||
lib/sync9w.f90
|
||||
lib/synciscat.f90
|
||||
lib/timf2.f90
|
||||
lib/to_contest_msg.f90
|
||||
lib/tweak1.f90
|
||||
lib/twkfreq.f90
|
||||
lib/fsk4hf/twkfreq1.f90
|
||||
|
@ -4,18 +4,19 @@
|
||||
#include <QRegularExpression>
|
||||
|
||||
extern "C" {
|
||||
bool stdmsg_(const char* msg, int len);
|
||||
bool stdmsg_(char const * msg, bool contest_mode, char const * mygrid, int len_msg, int len_grid);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
QRegularExpression words_re {R"(^(?:(?<word1>(?:CQ|DE|QRZ)(?:\s?DX|\s(?:[A-Z]{2}|\d{3}))|[A-Z0-9/]+)\s)(?:(?<word2>[A-Z0-9/]+)(?:\sR\s)?(?:\s(?<word3>[-+A-Z0-9]+)(?:\s(?<word4>OOO))?)?)?)"};
|
||||
QRegularExpression words_re {R"(^(?:(?<word1>(?:CQ|DE|QRZ)(?:\s?DX|\s(?:[A-Z]{2}|\d{3}))|[A-Z0-9/]+)\s)(?:(?<word2>[A-Z0-9/]+)(?:\s(?<word3>[-+A-Z0-9]+)(?:\s(?<word4>(?:OOO|(?!RR73)[A-R]{2}[0-9]{2})))?)?)?)"};
|
||||
}
|
||||
|
||||
DecodedText::DecodedText (QString const& the_string)
|
||||
DecodedText::DecodedText (QString const& the_string, bool contest_mode, QString const& my_grid)
|
||||
: string_ {the_string}
|
||||
, padding_ {the_string.indexOf (" ") > 4 ? 2 : 0} // allow for
|
||||
// seconds
|
||||
, contest_mode_ {contest_mode}
|
||||
, message_ {string_.mid (column_qsoText + padding_).trimmed ()}
|
||||
, is_standard_ {false}
|
||||
{
|
||||
@ -39,8 +40,16 @@ 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
|
||||
is_standard_ = stdmsg_ ((message_ + " ").toLatin1 ().constData (),22);
|
||||
// stdmsg is a fortran routine that packs the text, unpacks it
|
||||
// and compares the result
|
||||
auto message_c_string = message_.toLocal8Bit ();
|
||||
message_c_string.append (22 - message_c_string.size (), ' ');
|
||||
auto grid_c_string = my_grid.toLocal8Bit ();
|
||||
grid_c_string.append (6 - grid_c_string.size (), ' ');
|
||||
is_standard_ = stdmsg_ (message_c_string.constData ()
|
||||
, contest_mode_
|
||||
, grid_c_string.constData ()
|
||||
, 22, 6);
|
||||
}
|
||||
};
|
||||
|
||||
@ -157,22 +166,10 @@ void DecodedText::deCallAndGrid(/*out*/QString& call, QString& grid) const
|
||||
auto const& match = words_re.match (message_);
|
||||
call = match.captured ("word2");
|
||||
grid = match.captured ("word3");
|
||||
|
||||
// auto msg = string_;
|
||||
// if(msg.mid(4,1)!=" ") msg=msg.mid(0,4)+msg.mid(6,-1); //Remove seconds from UTC
|
||||
// msg = msg.replace (QRegularExpression {" CQ ([A-Z]{2,2}|[0-9]{3,3}) "}, " CQ_\\1 ").mid (column_qsoText + padding_);
|
||||
// int i1 = msg.indexOf (" ");
|
||||
// call = msg.mid (i1 + 1);
|
||||
// int i2 = call.indexOf (" ");
|
||||
// if (" R " == call.mid (i2, 3)) // MSK144 contest mode report
|
||||
// {
|
||||
// grid = call.mid (i2 + 3, 4);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// grid = call.mid (i2 + 1, 4);
|
||||
// }
|
||||
// call = call.left (i2).replace (">", "");
|
||||
if (contest_mode_ && "R" == grid)
|
||||
{
|
||||
grid = match.captured ("word4");
|
||||
}
|
||||
}
|
||||
|
||||
unsigned DecodedText::timeInSeconds() const
|
||||
|
@ -29,7 +29,7 @@
|
||||
class DecodedText
|
||||
{
|
||||
public:
|
||||
explicit DecodedText (QString const&);
|
||||
explicit DecodedText (QString const& message, bool, QString const& my_grid);
|
||||
|
||||
QString string() const { return string_; };
|
||||
QStringList messageWords () const;
|
||||
@ -77,6 +77,7 @@ private:
|
||||
|
||||
QString string_;
|
||||
int padding_;
|
||||
bool contest_mode_;
|
||||
QString message_;
|
||||
bool is_standard_;
|
||||
};
|
||||
|
@ -36,10 +36,8 @@ program contest72
|
||||
1001 format(a22)
|
||||
endif
|
||||
msg=msg0
|
||||
if(bcontest) call to_contest_msg(msg0,msg)
|
||||
call packmsg(msg,dat,itype)
|
||||
call unpackmsg(dat,msg1)
|
||||
call fix_contest_msg(mygrid,msg1)
|
||||
call packmsg(msg,dat,itype,bcontest)
|
||||
call unpackmsg(dat,msg1,bcontest,mygrid)
|
||||
ok=msg1.eq.msg0
|
||||
if(msg0.eq.' ') then
|
||||
write(*,1002)
|
||||
@ -78,9 +76,9 @@ program contest72
|
||||
cycle
|
||||
endif
|
||||
|
||||
call packmsg(msg,dat,itype)
|
||||
call packmsg(msg,dat,itype,.false.)
|
||||
write(ct1,1010) dat
|
||||
call packtext(msg,nc1,nc2,ng)
|
||||
call packtext(msg,nc1,nc2,ng,.false.,'')
|
||||
! write(ct2,1012) nc1,nc2,ng+32768
|
||||
!1012 format(2b28.28,b16.16)
|
||||
! write(*,1014) ct1
|
||||
|
@ -9,7 +9,7 @@ subroutine encode4(message,ncode)
|
||||
integer*1 data0(13),symbol(216)
|
||||
|
||||
call chkmsg(message,cok,nspecial,flip)
|
||||
call packmsg(message,dgen,itype) !Pack 72-bit message into 12 six-bit symbols
|
||||
call packmsg(message,dgen,itype,.false.) !Pack 72-bit message into 12 six-bit symbols
|
||||
call entail(dgen,data0)
|
||||
call encode232(data0,206,symbol) !Convolutional encoding
|
||||
call interleave4(symbol,1) !Apply JT4 interleaving
|
||||
|
@ -122,7 +122,7 @@ subroutine extract(s3,nadd,mode65,ntrials,naggressive,ndepth,nflip, &
|
||||
correct(1:63)=tmp(1:63)
|
||||
call interleave63(correct,63,1)
|
||||
call graycode65(correct,63,1)
|
||||
call unpackmsg(dat4,decoded) !Unpack the user message
|
||||
call unpackmsg(dat4,decoded,.false.,' ') !Unpack the user message
|
||||
ncount=0
|
||||
if(iand(dat4(10),8).ne.0) ltext=.true.
|
||||
endif
|
||||
|
@ -57,7 +57,7 @@ subroutine extract4(sym0,ncount,decoded)
|
||||
read(c72,1102) data4
|
||||
1102 format(12b6)
|
||||
|
||||
call unpackmsg(data4,decoded)
|
||||
call unpackmsg(data4,decoded,.false.,' ')
|
||||
if(decoded(1:6).eq.'000AAA') then
|
||||
! decoded='***WRONG MODE?***'
|
||||
decoded=' '
|
||||
|
@ -6,10 +6,9 @@ subroutine genft8(msg,mygrid,bcontest,msgsent,msgbits,itone)
|
||||
use packjt
|
||||
include 'ft8_params.f90'
|
||||
character*22 msg,msgsent
|
||||
character*6 mygrid,g1,g2,g3,g4
|
||||
character*6 mygrid
|
||||
character*87 cbits
|
||||
logical*1 bcontest
|
||||
logical isgrid
|
||||
logical bcontest
|
||||
integer*4 i4Msg6BitWords(12) !72-bit message as 6-bit words
|
||||
integer*1 msgbits(KK),codeword(3*ND)
|
||||
integer*1, target:: i1Msg8BitBytes(11)
|
||||
@ -17,41 +16,8 @@ subroutine genft8(msg,mygrid,bcontest,msgsent,msgbits,itone)
|
||||
integer icos7(0:6)
|
||||
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
||||
|
||||
isgrid(g1)=g1(1:1).ge.'A' .and. g1(1:1).le.'R' .and. g1(2:2).ge.'A' .and. &
|
||||
g1(2:2).le.'R' .and. g1(3:3).ge.'0' .and. g1(3:3).le.'9' .and. &
|
||||
g1(4:4).ge.'0' .and. g1(4:4).le.'9' .and. g1(1:4).ne.'RR73'
|
||||
|
||||
if(bcontest) then
|
||||
i0=index(msg,' R ') + 3 !Check for ' R ' in message
|
||||
g1=msg(i0:i0+3)//' '
|
||||
if(isgrid(g1)) then !Check for ' R grid'
|
||||
call grid2deg(g1,dlong,dlat)
|
||||
dlong=dlong+180.0
|
||||
if(dlong.gt.180.0) dlong=dlong-360.0
|
||||
dlat=-dlat
|
||||
call deg2grid(dlong,dlat,g2) !g2=antipodes grid
|
||||
msg=msg(1:i0-3)//g2(1:4) !Send message with g2
|
||||
endif
|
||||
endif
|
||||
|
||||
call packmsg(msg,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
|
||||
if(bcontest) then
|
||||
i1=index(msgsent(8:22),' ') + 8
|
||||
g3=msgsent(i1:i1+3)//' '
|
||||
if(isgrid(g3)) then
|
||||
call azdist(mygrid,g3,0.d0,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
|
||||
if(ndkm.gt.10000) then
|
||||
call grid2deg(g3,dlong,dlat)
|
||||
dlong=dlong+180.0
|
||||
if(dlong.gt.180.0) dlong=dlong-360.0
|
||||
dlat=-dlat
|
||||
call deg2grid(dlong,dlat,g4)
|
||||
msgsent=msgsent(1:i1-1)//'R '//g4(1:4)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
|
||||
|
||||
i3bit=0 !### temporary ###
|
||||
write(cbits,1000) i4Msg6BitWords,32*i3bit
|
||||
|
@ -66,8 +66,8 @@ allocate ( rxdata(N), llr(N) )
|
||||
|
||||
! msg="K1JT K9AN EN50"
|
||||
msg="G4WJS K9AN EN50"
|
||||
call packmsg(msg,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
call packmsg(msg,i4Msg6BitWords,itype,.false.) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,.false.,'') !Unpack to get msgsent
|
||||
write(*,*) "message sent ",msgsent
|
||||
|
||||
i4=0
|
||||
|
@ -71,8 +71,8 @@ allocate ( rxdata(N), llr(N) )
|
||||
|
||||
msg="K1JT K9AN EN50"
|
||||
! msg="G4WJS K9AN EN50"
|
||||
call packmsg(msg,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
call packmsg(msg,i4Msg6BitWords,itype,.false.) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,.false.,'') !Unpack to get msgsent
|
||||
write(*,*) "message sent ",msgsent
|
||||
|
||||
i4=0
|
||||
|
@ -26,8 +26,8 @@ subroutine gen4(msg0,ichk,msgsent,itone,itype)
|
||||
|
||||
message=msg0
|
||||
call fmtmsg(message,iz)
|
||||
call packmsg(message,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
call packmsg(message,i4Msg6BitWords,itype,.false.) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,.false.,' ') !Unpack to get msgsent
|
||||
if(ichk.ne.0) go to 999
|
||||
call encode4(message,itone) !Encode the information bits
|
||||
i1=index(message,'-')
|
||||
|
@ -44,8 +44,8 @@ subroutine gen65(msg0,ichk,msgsent,itone,itype)
|
||||
ntest=0
|
||||
if(flip.lt.0.0) ntest=1
|
||||
if(nspecial.eq.0) then
|
||||
call packmsg(message,dgen,itype) !Pack message into 72 bits
|
||||
call unpackmsg(dgen,msgsent) !Unpack to get message sent
|
||||
call packmsg(message,dgen,itype,.false.) !Pack message into 72 bits
|
||||
call unpackmsg(dgen,msgsent,.false.,' ') !Unpack to get message sent
|
||||
msgsent(20:22)=cok
|
||||
call fmtmsg(msgsent,iz)
|
||||
if(ichk.ne.0) go to 999 !Return if checking only
|
||||
|
@ -37,8 +37,8 @@ subroutine gen9(msg0,ichk,msgsent,i4tone,itype)
|
||||
message=message(i+1:)
|
||||
enddo
|
||||
|
||||
call packmsg(message,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
call packmsg(message,i4Msg6BitWords,itype,.false.) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,.false.,' ') !Unpack to get msgsent
|
||||
if(ichk.ne.0) go to 999
|
||||
call entail(i4Msg6BitWords,i1Msg8BitBytes) !Add tail, make 8-bit bytes
|
||||
nsym2=206
|
||||
|
@ -23,7 +23,7 @@ subroutine genmsk144(msg0,mygrid,ichk,bcontest,msgsent,i4tone,itype)
|
||||
character*22 msg0
|
||||
character*22 message !Message to be generated
|
||||
character*22 msgsent !Message as it will be received
|
||||
character*6 mygrid,g1,g2,g3,g4
|
||||
character*6 mygrid
|
||||
integer*4 i4Msg6BitWords(13) !72-bit message as 6-bit words
|
||||
integer*4 i4tone(144) !
|
||||
integer*1, target:: i1Msg8BitBytes(10) !80 bits represented in 10 bytes
|
||||
@ -32,19 +32,15 @@ subroutine genmsk144(msg0,mygrid,ichk,bcontest,msgsent,i4tone,itype)
|
||||
integer*1 bitseq(144) !Tone #s, data and sync (values 0-1)
|
||||
integer*1 i1hash(4)
|
||||
integer*1 s8(8)
|
||||
logical*1 bcontest
|
||||
logical bcontest
|
||||
real*8 pp(12)
|
||||
real*8 xi(864),xq(864),pi,twopi
|
||||
data s8/0,1,1,1,0,0,1,0/
|
||||
equivalence (ihash,i1hash)
|
||||
logical first,isgrid
|
||||
logical first
|
||||
data first/.true./
|
||||
save
|
||||
|
||||
isgrid(g1)=g1(1:1).ge.'A' .and. g1(1:1).le.'R' .and. g1(2:2).ge.'A' .and. &
|
||||
g1(2:2).le.'R' .and. g1(3:3).ge.'0' .and. g1(3:3).le.'9' .and. &
|
||||
g1(4:4).ge.'0' .and. g1(4:4).le.'9' .and. g1(1:4).ne.'RR73'
|
||||
|
||||
if(first) then
|
||||
first=.false.
|
||||
nsym=128
|
||||
@ -81,37 +77,8 @@ subroutine genmsk144(msg0,mygrid,ichk,bcontest,msgsent,i4tone,itype)
|
||||
go to 999
|
||||
endif
|
||||
|
||||
if(bcontest) then
|
||||
i0=index(message,' R ') + 3 !Check for ' R ' in message
|
||||
g1=message(i0:i0+3)//' '
|
||||
if(isgrid(g1)) then !Check for ' R grid'
|
||||
call grid2deg(g1,dlong,dlat)
|
||||
dlong=dlong+180.0
|
||||
if(dlong.gt.180.0) dlong=dlong-360.0
|
||||
dlat=-dlat
|
||||
call deg2grid(dlong,dlat,g2) !g2=antipodes grid
|
||||
message=message(1:i0-3)//g2(1:4) !Send message with g2
|
||||
endif
|
||||
endif
|
||||
|
||||
call packmsg(message,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
|
||||
if(bcontest) then
|
||||
i1=index(msgsent(8:22),' ') + 8
|
||||
g3=msgsent(i1:i1+3)//' '
|
||||
if(isgrid(g3)) then
|
||||
call azdist(mygrid,g3,0.d0,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
|
||||
if(ndkm.gt.10000) then
|
||||
call grid2deg(g3,dlong,dlat)
|
||||
dlong=dlong+180.0
|
||||
if(dlong.gt.180.0) dlong=dlong-360.0
|
||||
dlat=-dlat
|
||||
call deg2grid(dlong,dlat,g4)
|
||||
msgsent=msgsent(1:i1-1)//'R '//g4(1:4)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
call packmsg(message,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
|
||||
|
||||
if(ichk.eq.1) go to 999
|
||||
i4=0
|
||||
|
@ -37,8 +37,8 @@ subroutine genqra64(msg0,ichk,msgsent,itone,itype)
|
||||
enddo
|
||||
|
||||
call chkmsg(message,cok,nspecial,flip)
|
||||
call packmsg(message,dgen,itype) !Pack message into 72 bits
|
||||
call unpackmsg(dgen,msgsent) !Unpack to get message sent
|
||||
call packmsg(message,dgen,itype,.false.) !Pack message into 72 bits
|
||||
call unpackmsg(dgen,msgsent,.false.,' ') !Unpack to get message sent
|
||||
if(ichk.ne.0) go to 999 !Return if checking only
|
||||
call qra64_enc(dgen,sent) !Encode using QRA64
|
||||
|
||||
|
@ -88,7 +88,7 @@ subroutine hint65(s3,mrs,mrs2,nadd,nflip,mycall,hiscall,hisgrid,qual,decoded)
|
||||
if(m.eq.2) msg='CQ '//call2(i)//' '//grid2(i)
|
||||
endif
|
||||
call fmtmsg(msg,iz)
|
||||
call packmsg(msg,dgen,itype) !Pack message into 72 bits
|
||||
call packmsg(msg,dgen,itype,.false.) !Pack message into 72 bits
|
||||
call rs_encode(dgen,sym_rev) !RS encode
|
||||
sym(0:62)=sym_rev(62:0:-1)
|
||||
sym1(0:62,j)=sym
|
||||
|
@ -61,7 +61,7 @@ program JT65code
|
||||
go to 10
|
||||
endif
|
||||
|
||||
call packmsg(msg1,dgen,itype) !Pack message into 12 six-bit bytes
|
||||
call packmsg(msg1,dgen,itype,.false.) !Pack message into 12 six-bit bytes
|
||||
msgtype=""
|
||||
if(itype.eq.1) msgtype="Std Msg"
|
||||
if(itype.eq.2) msgtype="Type 1 pfx"
|
||||
@ -77,7 +77,7 @@ program JT65code
|
||||
call graycode(sent,63,-1,tmp) !Remove Gray code
|
||||
call interleave63(tmp,-1) !Remove interleaving
|
||||
call rs_decode(tmp,era,0,recd,nerr) !Decode the message
|
||||
call unpackmsg(recd,decoded) !Unpack the user message
|
||||
call unpackmsg(recd,decoded,.false.,' ') !Unpack the user message
|
||||
if(cok.eq."OOO") decoded(20:22)=cok
|
||||
call fmtmsg(decoded,iz)
|
||||
|
||||
|
@ -153,7 +153,7 @@ program jt65sim
|
||||
msg="K1ABC W9XYZ EN37"
|
||||
!###
|
||||
|
||||
call packmsg(msg,dgen,itype) !Pack message into 12 six-bit bytes
|
||||
call packmsg(msg,dgen,itype,.false.) !Pack message into 12 six-bit bytes
|
||||
call rs_encode(dgen,sent) !Encode using RS(63,12)
|
||||
call interleave63(sent,1) !Interleave channel symbols
|
||||
call graycode65(sent,63,1) !Apply Gray code
|
||||
|
@ -84,7 +84,7 @@ subroutine jt9fano(i1SoftSymbols,limit,nlim,msg)
|
||||
enddo
|
||||
call unpackbits(i4DecodedBytes,nbytes,8,i1DecodedBits)
|
||||
call packbits(i1DecodedBits,12,6,i4Decoded6BitWords)
|
||||
call unpackmsg(i4Decoded6BitWords,msg) !Unpack decoded msg
|
||||
call unpackmsg(i4Decoded6BitWords,msg,.false.,' ') !Unpack decoded msg
|
||||
if(index(msg,'000AAA ').gt.0) msg=' '
|
||||
endif
|
||||
|
||||
|
@ -53,8 +53,8 @@ allocate ( codeword(N), decoded(K), message(K) )
|
||||
allocate ( lratio(N), rxdata(N), rxavgd(N), yy(N), llr(N) )
|
||||
|
||||
msg="K9AN K1JT EN50"
|
||||
call packmsg(msg,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
call packmsg(msg,i4Msg6BitWords,itype,.false.) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,.false.,' ') !Unpack to get msgsent
|
||||
write(*,*) "message sent ",msgsent
|
||||
|
||||
i4=0
|
||||
|
@ -392,7 +392,7 @@ subroutine packbits(dbits,nsymd,m0,sym)
|
||||
900 return
|
||||
end subroutine unpackgrid
|
||||
|
||||
subroutine packmsg(msg0,dat,itype)
|
||||
subroutine packmsg(msg0,dat,itype,bcontest)
|
||||
|
||||
! Packs a JT4/JT9/JT65 message into twelve 6-bit symbols
|
||||
|
||||
@ -413,10 +413,15 @@ subroutine packbits(dbits,nsymd,m0,sym)
|
||||
character*12 c1,c2
|
||||
character*4 c3
|
||||
character*6 grid6
|
||||
logical text1,text2,text3
|
||||
logical text1,text2,text3,bcontest
|
||||
|
||||
msg=msg0
|
||||
itype=1
|
||||
if(bcontest) then
|
||||
call to_contest_msg(msg0,msg)
|
||||
else
|
||||
msg=msg0
|
||||
end if
|
||||
|
||||
call fmtmsg(msg,iz)
|
||||
|
||||
if(msg(1:6).eq.'CQ DX ') msg(3:3)='9'
|
||||
@ -525,13 +530,13 @@ subroutine packbits(dbits,nsymd,m0,sym)
|
||||
return
|
||||
end subroutine packmsg
|
||||
|
||||
subroutine unpackmsg(dat,msg)
|
||||
subroutine unpackmsg(dat,msg,bcontest,mygrid)
|
||||
|
||||
parameter (NBASE=37*36*10*27*27*27)
|
||||
parameter (NGBASE=180*180)
|
||||
integer dat(:)
|
||||
character c1*12,c2*12,grid*4,msg*22,grid6*6,psfx*4,junk2*4
|
||||
logical cqnnn
|
||||
character c1*12,c2*12,grid*4,msg*22,grid6*6,psfx*4,junk2*4,mygrid*6
|
||||
logical cqnnn,bcontest
|
||||
|
||||
cqnnn=.false.
|
||||
nc1=ishft(dat(1),22) + ishft(dat(2),16) + ishft(dat(3),10)+ &
|
||||
@ -645,6 +650,8 @@ subroutine packbits(dbits,nsymd,m0,sym)
|
||||
msg(4:4).ge.'A' .and. msg(4:4).le.'Z' .and. &
|
||||
msg(5:5).eq.' ') msg='CQ '//msg(3:)
|
||||
|
||||
if(bcontest) call fix_contest_msg(mygrid,msg)
|
||||
|
||||
return
|
||||
end subroutine unpackmsg
|
||||
|
||||
|
@ -128,7 +128,7 @@ subroutine qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
|
||||
10 decoded=' '
|
||||
|
||||
if(irc.ge.0) then
|
||||
call unpackmsg(dat4,decoded) !Unpack the user message
|
||||
call unpackmsg(dat4,decoded,.false.,' ') !Unpack the user message
|
||||
call fmtmsg(decoded,iz)
|
||||
if(index(decoded,"000AAA ").ge.1) then
|
||||
! Suppress a certain type of garbage decode.
|
||||
|
@ -34,7 +34,7 @@ program QRA64code
|
||||
msg0=msg !Input message
|
||||
call chkmsg(msg,cok,nspecial,flip) !See if it includes "OOO" report
|
||||
msg1=msg !Message without "OOO"
|
||||
call packmsg(msg1,dgen,itype) !Pack message into 12 six-bit bytes
|
||||
call packmsg(msg1,dgen,itype,.false.) !Pack message into 12 six-bit bytes
|
||||
msgtype=""
|
||||
if(itype.eq.1) msgtype="Std Msg"
|
||||
if(itype.eq.2) msgtype="Type 1 pfx"
|
||||
@ -45,7 +45,7 @@ program QRA64code
|
||||
|
||||
call qra64_enc(dgen,sent) !Encode using QRA64
|
||||
|
||||
call unpackmsg(dgen,decoded) !Unpack the user message
|
||||
call unpackmsg(dgen,decoded,.false.,' ') !Unpack the user message
|
||||
call fmtmsg(decoded,iz)
|
||||
ii=imsg
|
||||
write(*,1020) ii,msg0,decoded,itype,msgtype
|
||||
|
@ -1,11 +1,15 @@
|
||||
logical*1 function stdmsg(msg0)
|
||||
function stdmsg(msg0,bcontest,mygrid)
|
||||
|
||||
use iso_c_binding, only: c_bool
|
||||
use packjt
|
||||
character*22 msg0,msg
|
||||
character*6 mygrid
|
||||
integer dat(12)
|
||||
logical(c_bool), value :: bcontest
|
||||
logical(c_bool) :: stdmsg
|
||||
|
||||
call packmsg(msg0,dat,itype)
|
||||
call unpackmsg(dat,msg)
|
||||
call packmsg(msg0,dat,itype,logical(bcontest))
|
||||
call unpackmsg(dat,msg,logical(bcontest),mygrid)
|
||||
stdmsg=(msg.eq.msg0) .and. (itype.ge.0) .and. itype.ne.6
|
||||
|
||||
return
|
||||
|
@ -294,7 +294,7 @@ subroutine syncmsk(cdat,npts,jpk,ipk,idf,rmax,snr,metric,decoded)
|
||||
1012 format(9b8.8)
|
||||
read(c72,1014) i4Msg6BitWords
|
||||
1014 format(12b6.6)
|
||||
call unpackmsg(i4Msg6BitWords,decoded) !Unpack to get msgsent
|
||||
call unpackmsg(i4Msg6BitWords,decoded,.false.,' ') !Unpack to get msgsent
|
||||
endif
|
||||
if(decoded.ne.' ') exit
|
||||
enddo
|
||||
|
@ -1189,7 +1189,7 @@ void MainWindow::dataSink(qint64 frames)
|
||||
int ftol = ui->sbFtol->value ();
|
||||
freqcal_(&dec_data.d2[0],&k,&nkhz,&RxFreq,&ftol,&line[0],80);
|
||||
QString t=QString::fromLatin1(line);
|
||||
DecodedText decodedtext {t};
|
||||
DecodedText decodedtext {t, false, m_config.my_grid ()};
|
||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
||||
m_config.color_NewCall());
|
||||
@ -1424,7 +1424,7 @@ void MainWindow::fastSink(qint64 frames)
|
||||
|
||||
if(bmsk144 and (line[0]!=0)) {
|
||||
QString message {QString::fromLatin1 (line)};
|
||||
DecodedText decodedtext {message.replace (QChar::LineFeed, "")};
|
||||
DecodedText decodedtext {message.replace (QChar::LineFeed, ""), bcontest, m_config.my_grid ()};
|
||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
||||
m_config.color_NewCall());
|
||||
@ -2561,7 +2561,7 @@ void::MainWindow::fast_decode_done()
|
||||
if(narg[13]/8==narg[12]) message=message.trimmed().replace("<...>",m_calls);
|
||||
|
||||
//Left (Band activity) window
|
||||
DecodedText decodedtext {message.replace (QChar::LineFeed, "")};
|
||||
DecodedText decodedtext {message.replace (QChar::LineFeed, ""), "FT8" == m_mode && m_config.contestMode (), m_config.my_grid ()};
|
||||
if(!m_bFastDone) {
|
||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
||||
@ -2706,7 +2706,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
m_blankLine = false;
|
||||
}
|
||||
|
||||
DecodedText decodedtext {QString::fromUtf8 (t.constData ()).remove (QRegularExpression {"\r|\n"})};
|
||||
DecodedText decodedtext {QString::fromUtf8 (t.constData ()).remove (QRegularExpression {"\r|\n"}), "FT8" == m_mode && m_config.contestMode (), m_config.my_grid ()};
|
||||
|
||||
//Left (Band activity) window
|
||||
if(!bAvgMsg) {
|
||||
@ -3642,7 +3642,7 @@ void MainWindow::doubleClickOnCall(bool alt, bool ctrl)
|
||||
cursor=ui->decodedTextBrowser2->textCursor();
|
||||
}
|
||||
cursor.setPosition (cursor.selectionStart ());
|
||||
DecodedText message {cursor.block ().text ()};
|
||||
DecodedText message {cursor.block ().text (), ("MSK144" == m_mode || "FT8" == m_mode) && m_config.contestMode (), m_config.my_grid ()};
|
||||
m_bDoubleClicked = true;
|
||||
processMessage (message, ctrl, alt);
|
||||
}
|
||||
@ -3661,15 +3661,6 @@ void MainWindow::processMessage(DecodedText const& message, bool ctrl, bool alt)
|
||||
return;
|
||||
}
|
||||
|
||||
// QString t2a;
|
||||
// int ntsec=3600*t2.mid(0,2).toInt() + 60*t2.mid(2,2).toInt();
|
||||
// if(m_bFastMode or m_mode=="FT8") {
|
||||
// ntsec = ntsec + t2.mid(4,2).toInt();
|
||||
// t2a = t2.left (4) + t2.mid (6); //Change hhmmss to hhmm for the message parser
|
||||
// }
|
||||
//t2a = t2.left (44); // strip any quality info trailing the
|
||||
// decoded message
|
||||
|
||||
if(m_bFastMode or m_mode=="FT8") {
|
||||
auto i1=message.string ().indexOf(" CQ ");
|
||||
if(i1>10) {
|
||||
@ -3706,12 +3697,6 @@ void MainWindow::processMessage(DecodedText const& message, bool ctrl, bool alt)
|
||||
message.deCallAndGrid(/*out*/hiscall,hisgrid);
|
||||
auto is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size ();
|
||||
if (!is_73 && !message.isStandardMessage ())
|
||||
// && (!Radio::is_callsign (hiscall) // not interested if not from QSO partner
|
||||
// && !(t4.size () == 7 // unless it is of the form
|
||||
// && (t4.at (5) == m_baseCall // "<our-call> 73"
|
||||
// || t4.at (5).startsWith (m_baseCall + '/')
|
||||
// || t4.at (5).endsWith ('/' + m_baseCall))
|
||||
// && t4.at (6) == "73")))
|
||||
{
|
||||
qDebug () << "Not processing message - hiscall:" << hiscall << "hisgrid:" << hisgrid;
|
||||
return;
|
||||
@ -3929,7 +3914,7 @@ void MainWindow::processMessage(DecodedText const& message, bool ctrl, bool alt)
|
||||
ui->decodedTextBrowser2->displayDecodedText(message, m_baseCall,
|
||||
false, m_logBook,m_config.color_CQ(), m_config.color_MyCall(),
|
||||
m_config.color_DXCC(),m_config.color_NewCall());
|
||||
m_QSOText = s1;
|
||||
m_QSOText = s2;
|
||||
}
|
||||
|
||||
if (hiscall != "73"
|
||||
@ -6110,7 +6095,7 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de
|
||||
position = ui->decodedTextBrowser->toPlainText().indexOf(QChar::LineFeed,position);
|
||||
m_bDoubleClicked = true;
|
||||
auto start = messages.left (position).lastIndexOf (QChar::LineFeed) + 1;
|
||||
DecodedText message {messages.mid (start, position - start)};
|
||||
DecodedText message {messages.mid (start, position - start), ("MSK144" == m_mode || "FT8" == m_mode) && m_config.contestMode (), m_config.my_grid ()};
|
||||
processMessage (message);
|
||||
tx_watchdog (false);
|
||||
QApplication::alert (this);
|
||||
|
Loading…
Reference in New Issue
Block a user