Free-text messages get trimmed to 13 chars and have pink background.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2771 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-24 17:03:54 +00:00
parent abe540754b
commit dc303a2d65
3 changed files with 22 additions and 19 deletions

View File

@ -14,6 +14,7 @@ subroutine genjt9(msg0,msgsent,i4tone)
integer*4 i4DataSymbols(69) !Data symbols (values 0-7)
integer*4 i4GrayCodedSymbols(69) !Gray-coded symbols (values 0-7)
integer*4 i4tone(85) !Tone #s, data and sync (values 0-8)
logical text
include 'jt9sync.f90'
save
@ -30,9 +31,13 @@ subroutine genjt9(msg0,msgsent,i4tone)
message=message(i+1:)
enddo
call packmsg(message,i4Msg6BitWords) !Pack message into 12 6-bit bytes
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
if(i4tone(1).eq.-99) go to 999
call packmsg(message,i4Msg6BitWords,text) !Pack message into 12 6-bit bytes
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
if(i4tone(1).eq.-99) then
i4tone(2)=0
if(text) i4tone(2)=1
go to 999
endif
call entail(i4Msg6BitWords,i1Msg8BitBytes) !Add tail, convert to 8-bit bytes
nsym2=206
call encode232(i1Msg8BitBytes,nsym2,i1EncodedBits) !Encode K=32, r=1/2

View File

@ -1,4 +1,4 @@
subroutine packmsg(msg,dat)
subroutine packmsg(msg,dat,text)
parameter (NBASE=37*36*10*27*27*27)
parameter (NBASE2=262178562)
@ -7,8 +7,9 @@
character*12 c1,c2
character*4 c3
character*6 grid6
logical text1,text2,text3
logical text1,text2,text3,text
text=.false.
C Convert all letters to upper case
iz=22
do i=1,22
@ -88,7 +89,8 @@ C ... and if so, does it have a reply frequency?
endif
C The message will be treated as plain text.
10 call packtext(msg,nc1,nc2,ng)
10 text=.true.
call packtext(msg,nc1,nc2,ng)
ng=ng+32768
C Encode data into 6-bit words

View File

@ -1441,36 +1441,32 @@ void MainWindow::on_addButton_clicked() //Add button
void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype()
{
char message[23];
char msgsent[23];
int len1=22;
int jtone[85];
int nsendingsh=0;
t=t.toUpper();
int i1=t.indexOf(" OOO");
QByteArray s=t.toUpper().toLocal8Bit();
ba2msg(s,message);
jtone[0]=-99;
genjt9_(message,msgsent,jtone,len1,len1);
nsendingsh=0;
msgsent[22]=0;
bool text=false;
if(jtone[1]==1) text=true;
QString t1;
t1.fromAscii(msgsent);
if(text) t1=t1.mid(0,13);
QPalette p(tx->palette());
if(nsendingsh==1) {
p.setColor(QPalette::Base,"#66ffff");
} else if(nsendingsh==-1) {
if(text) {
p.setColor(QPalette::Base,"#ffccff");
} else {
p.setColor(QPalette::Base,Qt::white);
}
tx->setPalette(p);
int len=t.length();
if(nsendingsh==-1) {
if(text) {
len=qMin(len,13);
if(i1>10) {
tx->setText(t.mid(0,len).toUpper() + " OOO");
} else {
tx->setText(t.mid(0,len).toUpper());
}
tx->setText(t.mid(0,len).toUpper());
} else {
tx->setText(t);
}