From e1ceeb6d12465f35530ec6f8d2ad5e4bb8c14f9b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 15 Jan 2016 21:53:27 +0000 Subject: [PATCH] Adjust the GUI to accommodate JTMSK shorthand messages. (NB: Tx message echoed with yellow background is incomplete.) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6403 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/genmsk.f90 | 4 ++-- lib/genmsk_short.f90 | 1 + mainwindow.cpp | 9 ++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/genmsk.f90 b/lib/genmsk.f90 index 804e60075..7eccb443d 100644 --- a/lib/genmsk.f90 +++ b/lib/genmsk.f90 @@ -54,7 +54,7 @@ subroutine genmsk(msg0,ichk,msgsent,i4tone,itype) call genmsk_short(message,msgsent,i4tone,itype) if(itype.lt.0) go to 999 i4tone(38)=-37 - go to 900 + go to 999 endif call packmsg(message,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes @@ -100,7 +100,7 @@ subroutine genmsk(msg0,ichk,msgsent,i4tone,itype) if(mod(nn3,2).eq.0) i4tone(36+n1+n2+n3)=1 !1 parity bit endif -900 n=count(i4tone.eq.0) + n=count(i4tone.eq.0) if(mod(n,2).ne.0) stop 'Parity error in genmsk.' 999 return diff --git a/lib/genmsk_short.f90 b/lib/genmsk_short.f90 index 70aca56e3..b4860f1cf 100644 --- a/lib/genmsk_short.f90 +++ b/lib/genmsk_short.f90 @@ -15,6 +15,7 @@ subroutine genmsk_short(msg,msgsent,itone,itype) itone=0 i1=index(msg,'>') if(i1.lt.9) go to 900 + call fmtmsg(msg,iz) crpt=msg(i1+2:i1+5) do i=0,7 if(crpt.eq.rpt(i)) go to 10 diff --git a/mainwindow.cpp b/mainwindow.cpp index d8e632727..fa1107070 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -120,7 +120,7 @@ QVector g_ColorTbl; namespace { Radio::Frequency constexpr default_frequency {14076000}; - QRegExp message_alphabet {"[- @A-Za-z0-9+./?#]*"}; + QRegExp message_alphabet {"[- @A-Za-z0-9+./?#<>]*"}; bool message_is_73 (int type, QStringList const& msg_parts) { @@ -3309,7 +3309,8 @@ void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype() tx->setPalette(p); int len=t.length(); auto pos = tx->cursorPosition (); - if(text) { +// if(text) { + if(text && m_mode!="JTMSK" && t.mid(0,1)!="<") { len=qMin(len,13); tx->setText(t.mid(0,len).toUpper()); } else { @@ -4338,7 +4339,9 @@ void MainWindow::transmit (double snr) m_nsps=6; m_toneSpacing=6000.0/m_nsps; double f0=1000.0; - Q_EMIT sendMessage (NUM_JTMSK_SYMBOLS, double(m_nsps), f0, m_toneSpacing, + int nsym=NUM_JTMSK_SYMBOLS; + if(itone[37] < 0) nsym=37; + Q_EMIT sendMessage (nsym, double(m_nsps), f0, m_toneSpacing, m_soundOutput, m_config.audio_output_channel (), true, true, snr, m_TRperiod); }