Fixed issues with double printing of messages and skipping printing some frames
This commit is contained in:
parent
08357c4b11
commit
ed9228d196
@ -22,7 +22,7 @@ subroutine ft8apset(mycall12,mygrid6,hiscall12,hisgrid6,bcontest,apsym,iaptype)
|
||||
! hisgrid=hisgrid6(1:4)
|
||||
!! if(len_trim(hisgrid).eq.0) hisgrid="EN50"
|
||||
! if(index(hisgrid," ").eq.0) hisgrid="EN50"
|
||||
msg='tZQpZP-slh4+'
|
||||
msg='tZQpZP-slh4+' ! HELLO WORLD
|
||||
i3bit=0 ! ### TEMPORARY ??? ###
|
||||
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
|
||||
apsym=2*msgbits-1
|
||||
|
@ -374,14 +374,11 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
||||
cycle
|
||||
endif
|
||||
i3bit=4*decoded(73) + 2*decoded(74) + decoded(75)
|
||||
iFreeText=decoded(57)
|
||||
if(nbadcrc.eq.0) then
|
||||
decoded0=decoded
|
||||
if(i3bit.eq.1) decoded(57:)=0
|
||||
call extractmessage174(decoded,origmsg,ncrcflag)
|
||||
decoded=decoded0
|
||||
|
||||
! This needs fixing for messages with i3bit=1:
|
||||
message(1:12)=origmsg(1:12)
|
||||
call genft8(message,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
|
||||
if(lsubtract) call subtractft8(dd0,itone,f1,xdt2)
|
||||
@ -398,48 +395,10 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
||||
xsnr2=db(xsig/xbase - 1.0) - 32.0
|
||||
if(.not.nagain) xsnr=xsnr2
|
||||
if(xsnr .lt. -24.0) xsnr=-24.0
|
||||
|
||||
|
||||
! if(i3bit.eq.1) then
|
||||
! do i=1,12
|
||||
! i1hiscall(i)=ichar(hiscall12(i:i))
|
||||
! enddo
|
||||
! icrc10=crc10(c_loc(i1hiscall),12)
|
||||
! write(cbits,1001) decoded
|
||||
!1001 format(87i1)
|
||||
! read(cbits,1002) ncrc10,nrpt
|
||||
!1002 format(56x,b10,b6)
|
||||
! irpt=nrpt-30
|
||||
! i1=index(message,' ')
|
||||
! i2=index(message(i1+1:),' ') + i1
|
||||
! c1=message(1:i1)//' '
|
||||
! c2=message(i1+1:i2)//' '
|
||||
!
|
||||
! if(ncrc10.eq.icrc10) msg37=c1//' RR73; '//c2//' <'// &
|
||||
! trim(hiscall12)//'> '
|
||||
! if(ncrc10.ne.icrc10) msg37=c1//' RR73; '//c2//' <...> '
|
||||
!
|
||||
!! msg37=c1//' RR73; '//c2//' <...> '
|
||||
! write(msg37(35:37),1010) irpt
|
||||
!1010 format(i3.2)
|
||||
! if(msg37(35:35).ne.'-') msg37(35:35)='+'
|
||||
!
|
||||
! iz=len(trim(msg37))
|
||||
! do iter=1,10 !Collapse multiple blanks
|
||||
! ib2=index(msg37(1:iz),' ')
|
||||
! if(ib2.lt.1) exit
|
||||
! msg37=msg37(1:ib2)//msg37(ib2+2:)
|
||||
! iz=iz-1
|
||||
! enddo
|
||||
! else
|
||||
! msg37=message//' '
|
||||
! endif
|
||||
|
||||
msg37=origmsg//' '
|
||||
|
||||
if(i3bit.gt.1) then
|
||||
msg37(22:22) = char(48 + i3bit)
|
||||
endif
|
||||
msg37(22:22) = char(48 + i3bit)
|
||||
|
||||
return
|
||||
endif
|
||||
|
@ -62,21 +62,17 @@ program ft8code
|
||||
msgchk=msg
|
||||
|
||||
! Generate msgsent, msgbits, and itone
|
||||
if(index(msg,';').le.0) then
|
||||
call packmsg(msg(1:22),dgen,itype,bcontest)
|
||||
msgtype=""
|
||||
if(itype.eq.1) msgtype="Std Msg"
|
||||
if(itype.eq.2) msgtype="Type 1 pfx"
|
||||
if(itype.eq.3) msgtype="Type 1 sfx"
|
||||
if(itype.eq.4) msgtype="Type 2 pfx"
|
||||
if(itype.eq.5) msgtype="Type 2 sfx"
|
||||
if(itype.eq.6) msgtype="Free text"
|
||||
i3bit=0
|
||||
call genft8(msg(1:22),mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
|
||||
else
|
||||
call foxgen_wrap(msg,msgbits,itone)
|
||||
i3bit=1
|
||||
endif
|
||||
call packmsg(msg(1:22),dgen,itype,bcontest)
|
||||
msgtype=""
|
||||
if(itype.eq.1) msgtype="Std Msg"
|
||||
if(itype.eq.2) msgtype="Type 1 pfx"
|
||||
if(itype.eq.3) msgtype="Type 1 sfx"
|
||||
if(itype.eq.4) msgtype="Type 2 pfx"
|
||||
if(itype.eq.5) msgtype="Type 2 sfx"
|
||||
if(itype.eq.6) msgtype="Free text"
|
||||
i3bit=0
|
||||
call genft8(msg(1:22),mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
|
||||
|
||||
decoded=msgbits
|
||||
i3bit=4*decoded(73) + 2*decoded(74) + decoded(75)
|
||||
iFreeText=decoded(57)
|
||||
@ -85,40 +81,14 @@ program ft8code
|
||||
call extractmessage174(decoded,message,ncrcflag)
|
||||
decoded=decoded0
|
||||
|
||||
if(i3bit.eq.0) then
|
||||
if(bcontest) call fix_contest_msg(mygrid6,message)
|
||||
bad=" "
|
||||
comment=' '
|
||||
if(itype.ne.6 .and. message.ne.msgchk) bad="*"
|
||||
if(itype.eq.6 .and. message(1:13).ne.msgchk(1:13)) bad="*"
|
||||
if(itype.eq.6 .and. len(trim(msgchk)).gt.13) comment='truncated'
|
||||
write(*,1020) imsg,msgchk,message,bad,i3bit,itype,msgtype,comment
|
||||
if(bcontest) call fix_contest_msg(mygrid6,message)
|
||||
bad=" "
|
||||
comment=' '
|
||||
if(itype.ne.6 .and. message.ne.msgchk) bad="*"
|
||||
if(itype.eq.6 .and. message(1:13).ne.msgchk(1:13)) bad="*"
|
||||
if(itype.eq.6 .and. len(trim(msgchk)).gt.13) comment='truncated'
|
||||
write(*,1020) imsg,msgchk,message,bad,i3bit,itype,msgtype,comment
|
||||
1020 format(i2,'.',1x,a22,1x,a22,1x,a1,2i2,1x,a10,1x,a9)
|
||||
else
|
||||
write(cbits,1001) decoded
|
||||
1001 format(87i1)
|
||||
read(cbits,1002) nrpt
|
||||
1002 format(66x,b6)
|
||||
irpt=nrpt-30
|
||||
i1=index(message,' ')
|
||||
i2=index(message(i1+1:),' ') + i1
|
||||
c1=message(1:i1)//' '
|
||||
c2=message(i1+1:i2)//' '
|
||||
msg37=c1//' RR73; '//c2//' <...> '
|
||||
write(msg37(35:37),1003) irpt
|
||||
1003 format(i3.2)
|
||||
if(msg37(35:35).ne.'-') msg37(35:35)='+'
|
||||
iz=len(trim(msg37))
|
||||
do iter=1,10 !Collapse multiple blanks into one
|
||||
ib2=index(msg37(1:iz),' ')
|
||||
if(ib2.lt.1) exit
|
||||
msg37=msg37(1:ib2)//msg37(ib2+2:)
|
||||
iz=iz-1
|
||||
enddo
|
||||
|
||||
write(*,1021) imsg,msgchk,msg37
|
||||
1021 format(i2,'.',1x,a40,1x,a37)
|
||||
endif
|
||||
|
||||
enddo
|
||||
|
||||
|
196
mainwindow.cpp
196
mainwindow.cpp
@ -3291,11 +3291,14 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
}
|
||||
}
|
||||
|
||||
// only display frames that are FT8Call frames (should decrease false decodes by at least 50%)
|
||||
// only display frames that are FT8Call frames (should decrease false decodes by at least 12%)
|
||||
int bits = decodedtext.bits();
|
||||
|
||||
bool bValidFrame = (
|
||||
decodedtext.bits() == Varicode::FT8CallFirst ||
|
||||
decodedtext.bits() == Varicode::FT8Call ||
|
||||
decodedtext.bits() == Varicode::FT8CallLast
|
||||
bits == Varicode::FT8Call ||
|
||||
((bits & Varicode::FT8CallFirst) == Varicode::FT8CallFirst) ||
|
||||
((bits & Varicode::FT8CallLast) == Varicode::FT8CallLast) ||
|
||||
((bits & Varicode::FT8CallReserved) == 0 /*Varicode::FT8CallReserved*/) // This is unused...so is invalid at this time...
|
||||
);
|
||||
|
||||
qDebug() << "valid" << bValidFrame << "decoded text" << decodedtext.message();
|
||||
@ -3334,7 +3337,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
d.isBuffered = false;
|
||||
|
||||
// if we have any "first" frame, and a buffer is already established, clear it...
|
||||
if(d.bits == Varicode::FT8CallFirst && m_messageBuffer.contains(d.freq/10*10)){
|
||||
if(((d.bits & Varicode::FT8CallFirst) == Varicode::FT8CallFirst) && m_messageBuffer.contains(d.freq/10*10)){
|
||||
qDebug() << "first message encountered, clearing existing buffer" << (d.freq/10*10);
|
||||
m_messageBuffer.remove(d.freq/10*10);
|
||||
}
|
||||
@ -5631,28 +5634,17 @@ void MainWindow::clearActivity(){
|
||||
update_dynamic_property(ui->extFreeTextMsgEdit, "transmitting", false);
|
||||
}
|
||||
|
||||
void MainWindow::displayTextForFreq(QString text, int freq, QDateTime date, bool bold, bool newLine, bool clearLine){
|
||||
void MainWindow::displayTextForFreq(QString text, int freq, QDateTime date, bool isTx, bool isNewLine, bool isLast){
|
||||
int block = m_rxFrameBlockNumbers.contains(freq) ? m_rxFrameBlockNumbers[freq] : -1;
|
||||
if(clearLine && block != -1){
|
||||
auto c = ui->textEditRX->textCursor();
|
||||
QTextBlock b = c.document()->findBlockByNumber(block);
|
||||
c.setPosition(b.position());
|
||||
c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
|
||||
c.deleteChar();
|
||||
c.deleteChar();
|
||||
block = -1;
|
||||
m_rxFrameBlockNumbers.remove(freq);
|
||||
}
|
||||
|
||||
if(newLine){
|
||||
if(isNewLine){
|
||||
m_rxFrameBlockNumbers.remove(freq);
|
||||
block = -1;
|
||||
}
|
||||
|
||||
block = writeMessageTextToUI(date, text, freq, bold, block);
|
||||
block = writeMessageTextToUI(date, text, freq, isTx, block);
|
||||
|
||||
// TODO: jsherer - might be better to see if the bits are "last" versus checking for the EOT
|
||||
if(!text.contains("\u2301")){
|
||||
// never cache tx or last lines
|
||||
if(!isTx && !isLast){
|
||||
m_rxFrameBlockNumbers.insert(freq, block);
|
||||
}
|
||||
}
|
||||
@ -5764,8 +5756,7 @@ void MainWindow::createMessageTransmitQueue(QString const& text){
|
||||
lines.append(dt.message());
|
||||
}
|
||||
|
||||
//logMessageText(QDateTime::currentDateTimeUtc(), lines.join(""), freq, true);
|
||||
displayTextForFreq(lines.join(""), freq, QDateTime::currentDateTimeUtc(), true, true, false);
|
||||
displayTextForFreq(lines.join(""), freq, QDateTime::currentDateTimeUtc(), true, true, true);
|
||||
|
||||
// keep track of the last message text sent
|
||||
m_lastTxMessage = text;
|
||||
@ -6008,8 +5999,7 @@ QStringList MainWindow::buildFT8MessageFrames(QString const& text){
|
||||
line = lstrip(line);
|
||||
|
||||
qDebug() << "before:" << line;
|
||||
bool shouldUseLargeChecksum = true;
|
||||
if(shouldUseLargeChecksum && dirCmd == "#"){
|
||||
if(dirCmd == "#"){
|
||||
line = line + " " + Varicode::checksum32(line);
|
||||
} else {
|
||||
line = line + " " + Varicode::checksum16(line);
|
||||
@ -6092,9 +6082,10 @@ QString MainWindow::parseFT8Message(QString input, bool *isFree){
|
||||
|
||||
bool MainWindow::prepareNextMessageFrame()
|
||||
{
|
||||
m_i3bit = Varicode::FT8Call;
|
||||
|
||||
QString frame = popMessageFrame();
|
||||
if(frame.isEmpty()){
|
||||
m_i3bit = Varicode::FT8;
|
||||
if(frame.isEmpty()){
|
||||
ui->nextFreeTextMsg->clear();
|
||||
return false;
|
||||
} else {
|
||||
@ -6103,12 +6094,11 @@ bool MainWindow::prepareNextMessageFrame()
|
||||
int count = m_txFrameCount;
|
||||
int sent = count - m_txFrameQueue.count();
|
||||
|
||||
m_i3bit = Varicode::FT8Call;
|
||||
if(sent == 1){
|
||||
m_i3bit = Varicode::FT8CallFirst;
|
||||
m_i3bit |= Varicode::FT8CallFirst;
|
||||
}
|
||||
if(count == sent){
|
||||
m_i3bit = Varicode::FT8CallLast;
|
||||
m_i3bit |= Varicode::FT8CallLast;
|
||||
}
|
||||
|
||||
ui->startTxButton->setText(QString("Sending (%1/%2)").arg(sent).arg(count));
|
||||
@ -7296,6 +7286,7 @@ void MainWindow::on_tableWidgetRXAll_cellDoubleClicked(int row, int col){
|
||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||
QDateTime firstActivity = now;
|
||||
QString activityText;
|
||||
bool isLast = false;
|
||||
foreach(auto d, m_bandActivity[offset]){
|
||||
if(activityAging && d.utcTimestamp.secsTo(now)/60 >= activityAging){
|
||||
continue;
|
||||
@ -7304,25 +7295,16 @@ void MainWindow::on_tableWidgetRXAll_cellDoubleClicked(int row, int col){
|
||||
firstActivity = d.utcTimestamp;
|
||||
}
|
||||
activityText.append(d.text);
|
||||
}
|
||||
if(!activityText.isEmpty()){
|
||||
//int block = logMessageText(firstActivity, activityText, offset, false);
|
||||
|
||||
displayTextForFreq(activityText, offset, firstActivity, false, true, false);
|
||||
|
||||
// TODO: jsherer - evaluate recency cache...
|
||||
// m_rxRecentCache.insert(offset/10*10, new QDateTime(QDateTime::currentDateTimeUtc()), 25);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// drop the callsign (if one) in the edit window
|
||||
foreach(auto d, m_callActivity.values()){
|
||||
if(d.freq == offset){
|
||||
addMessageText(d.call);
|
||||
break;
|
||||
isLast = (d.bits & Varicode::FT8CallLast) == Varicode::FT8CallLast;
|
||||
if(isLast){
|
||||
// can also use \u0004 \u2666 \u2404
|
||||
activityText.append(" \u2301 ");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(!activityText.isEmpty()){
|
||||
displayTextForFreq(activityText, offset, firstActivity, false, true, isLast);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_tableWidgetRXAll_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/){
|
||||
@ -8302,12 +8284,20 @@ QString MainWindow::callsignSelected(){
|
||||
}
|
||||
|
||||
bool MainWindow::isRecentOffset(int offset){
|
||||
if(abs(offset - currentFreqOffset()) <= 10){
|
||||
return true;
|
||||
}
|
||||
return (
|
||||
m_rxRecentCache.contains(offset/10*10) &&
|
||||
m_rxRecentCache[offset/10*10]->secsTo(QDateTime::currentDateTimeUtc()) < 120
|
||||
);
|
||||
}
|
||||
|
||||
void MainWindow::markOffsetRecent(int offset){
|
||||
m_rxRecentCache.insert(offset/10*10, new QDateTime(QDateTime::currentDateTimeUtc()), 10);
|
||||
m_rxRecentCache.insert(offset/10*10+10, new QDateTime(QDateTime::currentDateTimeUtc()), 10);
|
||||
}
|
||||
|
||||
bool MainWindow::isDirectedOffset(int offset){
|
||||
return (
|
||||
m_rxDirectedCache.contains(offset/10*10) &&
|
||||
@ -8316,7 +8306,8 @@ bool MainWindow::isDirectedOffset(int offset){
|
||||
}
|
||||
|
||||
void MainWindow::markOffsetDirected(int offset){
|
||||
m_rxDirectedCache.insert(offset/10*10, new QDateTime(QDateTime::currentDateTimeUtc()), 25);
|
||||
m_rxDirectedCache.insert(offset/10*10, new QDateTime(QDateTime::currentDateTimeUtc()), 10);
|
||||
m_rxDirectedCache.insert(offset/10*10+10, new QDateTime(QDateTime::currentDateTimeUtc()), 10);
|
||||
}
|
||||
|
||||
bool MainWindow::isMyCallIncluded(const QString &text){
|
||||
@ -8366,18 +8357,31 @@ void MainWindow::processRxActivity() {
|
||||
|
||||
// if this is a compound message or it's a directed message needing a compound call, skip.
|
||||
// these messages will be displayed when the compound calls come through
|
||||
#if 0
|
||||
if(d.isCompound || (d.isDirected && d.text.contains("<....>"))){
|
||||
#endif
|
||||
|
||||
// if this is a _partial_ directed message, skip until the complete call comes through.
|
||||
if(d.isDirected && d.text.contains("<....>")){
|
||||
continue;
|
||||
}
|
||||
|
||||
int freq = d.freq / 10 * 10;
|
||||
// use the actual frequency and check its delta from our current frequency
|
||||
// meaning, if our current offset is 1502 and the d.freq is 1492, the delta is <= 10;
|
||||
bool shouldDisplay = abs(d.freq - currentFreqOffset()) <= 10;
|
||||
|
||||
bool shouldDisplay = abs(freq - currentFreqOffset()) <= 10;
|
||||
#if 0
|
||||
// if this is a recent non-directed offset, bump the cache and display...
|
||||
if(isRecentOffset(d.freq)){
|
||||
markOffsetRecent(d.freq);
|
||||
shouldDisplay = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// if this is a (recent) directed offset, bump the cache, and display...
|
||||
// this will allow a directed free text command followed by non-buffered data frames.
|
||||
if(isDirectedOffset(freq)){
|
||||
markOffsetDirected(freq);
|
||||
if(isDirectedOffset(d.freq)){
|
||||
markOffsetDirected(d.freq);
|
||||
shouldDisplay = true;
|
||||
}
|
||||
|
||||
@ -8394,33 +8398,29 @@ void MainWindow::processRxActivity() {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if(!shouldDisplay){
|
||||
continue;
|
||||
}
|
||||
|
||||
// ok, we're good to display...let's cache that fact and then display!
|
||||
bool isLast = d.bits == Varicode::FT8CallLast;
|
||||
markOffsetRecent(d.freq);
|
||||
|
||||
bool isFirst = (d.bits & Varicode::FT8CallFirst) == Varicode::FT8CallFirst;
|
||||
bool isLast = (d.bits & Varicode::FT8CallLast) == Varicode::FT8CallLast;
|
||||
|
||||
// if we're the last message, let's display our EOT character
|
||||
if (isLast) {
|
||||
// can also use \u0004 \u2666 \u2404
|
||||
d.text = QString("%1 \u2301 ").arg(d.text);
|
||||
}
|
||||
|
||||
// log it to the display!
|
||||
// int block = m_rxFrameBlockNumbers.contains(freq) ? m_rxFrameBlockNumbers[freq] : -1;
|
||||
// m_rxFrameBlockNumbers[freq] = logMessageText(d.utcTimestamp, d.text, d.freq, false, block);
|
||||
// if (isLast) {
|
||||
// m_rxFrameBlockNumbers.remove(freq);
|
||||
// }
|
||||
// m_rxRecentCache.insert(freq, new QDateTime(QDateTime::currentDateTimeUtc()), 25);
|
||||
|
||||
displayTextForFreq(d.text, d.freq, d.utcTimestamp, false, false, false);
|
||||
displayTextForFreq(d.text, d.freq, d.utcTimestamp, false, isFirst, isLast);
|
||||
|
||||
if(isLast && !d.isBuffered){
|
||||
// buffered commands need the rxFrameBlockNumbers cache so it can fixup its display
|
||||
// all other "last" data frames can clear the rxFrameBlockNumbers cache so the next message will be on a new line.
|
||||
m_rxFrameBlockNumbers.remove(freq);
|
||||
m_rxFrameBlockNumbers.remove(d.freq);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8444,7 +8444,14 @@ void MainWindow::processCompoundActivity() {
|
||||
}
|
||||
|
||||
// if we don't have an initialized command, skip...
|
||||
if (buffer.cmd.bits != Varicode::FT8Call && buffer.cmd.bits != Varicode::FT8CallFirst && buffer.cmd.bits != Varicode::FT8CallLast) {
|
||||
int bits = buffer.cmd.bits;
|
||||
bool validBits = (
|
||||
bits == Varicode::FT8Call ||
|
||||
((bits & Varicode::FT8CallFirst) == Varicode::FT8CallFirst) ||
|
||||
((bits & Varicode::FT8CallLast) == Varicode::FT8CallLast) ||
|
||||
((bits & Varicode::FT8CallReserved) == Varicode::FT8CallReserved)
|
||||
);
|
||||
if (!validBits) {
|
||||
qDebug() << "-> buffer.cmd bits is invalid...skip";
|
||||
continue;
|
||||
}
|
||||
@ -8467,7 +8474,7 @@ void MainWindow::processCompoundActivity() {
|
||||
buffer.cmd.grid = d.grid;
|
||||
buffer.cmd.isCompound = true;
|
||||
|
||||
if (d.bits == Varicode::FT8CallLast) {
|
||||
if ((d.bits & Varicode::FT8CallLast) == Varicode::FT8CallLast) {
|
||||
buffer.cmd.bits = d.bits;
|
||||
}
|
||||
}
|
||||
@ -8477,12 +8484,12 @@ void MainWindow::processCompoundActivity() {
|
||||
buffer.cmd.to = d.call;
|
||||
buffer.cmd.isCompound = true;
|
||||
|
||||
if (d.bits == Varicode::FT8CallLast) {
|
||||
if ((d.bits & Varicode::FT8CallLast) == Varicode::FT8CallLast) {
|
||||
buffer.cmd.bits = d.bits;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer.cmd.bits != Varicode::FT8CallLast) {
|
||||
if ((buffer.cmd.bits & Varicode::FT8CallLast) != Varicode::FT8CallLast) {
|
||||
qDebug() << "-> still not last message...skip";
|
||||
continue;
|
||||
}
|
||||
@ -8506,7 +8513,7 @@ void MainWindow::processBufferedActivity() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (buffer.msgs.last().bits != Varicode::FT8CallLast) {
|
||||
if ((buffer.msgs.last().bits & Varicode::FT8CallLast) != Varicode::FT8CallLast) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -8520,19 +8527,23 @@ void MainWindow::processBufferedActivity() {
|
||||
|
||||
bool valid = false;
|
||||
|
||||
bool shouldUseLargeChecksum = true;
|
||||
if(shouldUseLargeChecksum && buffer.cmd.cmd == "#"){
|
||||
checksum = message.right(6);
|
||||
message = message.left(message.length() - 7);
|
||||
valid = Varicode::checksum32Valid(checksum, message);
|
||||
if(Varicode::isCommandBuffered(buffer.cmd.cmd)){
|
||||
if(buffer.cmd.cmd == "#"){
|
||||
checksum = message.right(6);
|
||||
message = message.left(message.length() - 7);
|
||||
valid = Varicode::checksum32Valid(checksum, message);
|
||||
} else {
|
||||
checksum = message.right(3);
|
||||
message = message.left(message.length() - 4);
|
||||
valid = Varicode::checksum16Valid(checksum, message);
|
||||
}
|
||||
} else {
|
||||
checksum = message.right(3);
|
||||
message = message.left(message.length() - 4);
|
||||
valid = Varicode::checksum16Valid(checksum, message);
|
||||
valid = true;
|
||||
}
|
||||
|
||||
|
||||
if (valid) {
|
||||
buffer.cmd.bits = Varicode::FT8CallLast;
|
||||
buffer.cmd.bits |= Varicode::FT8CallLast;
|
||||
buffer.cmd.text = message;
|
||||
buffer.cmd.isBuffered = true;
|
||||
m_rxCommandQueue.append(buffer.cmd);
|
||||
@ -8627,15 +8638,30 @@ void MainWindow::processCommandActivity() {
|
||||
if(!d.text.isEmpty()){
|
||||
ad.text += d.text;
|
||||
}
|
||||
bool isLast = ad.bits == Varicode::FT8CallLast;
|
||||
bool isLast = (ad.bits & Varicode::FT8CallLast) == Varicode::FT8CallLast;
|
||||
if (isLast) {
|
||||
// can also use \u0004 \u2666 \u2404
|
||||
ad.text += QString(" \u2301 ");
|
||||
}
|
||||
ad.utcTimestamp = d.utcTimestamp;
|
||||
|
||||
// log it to the display!
|
||||
displayTextForFreq(ad.text, ad.freq, ad.utcTimestamp, false, true, true);
|
||||
|
||||
// we'd be double printing here if were on frequency, so let's be "smart" about this...
|
||||
bool shouldDisplay = true;
|
||||
if(shouldDisplay){
|
||||
if(isRecentOffset(d.freq) && ui->textEditRX->find(QString("(%1)").arg(ad.freq), QTextDocument::FindBackward)){
|
||||
// ... maybe we could delete the last line that had this message on this frequency...
|
||||
auto c = ui->textEditRX->textCursor();
|
||||
c.movePosition(QTextCursor::StartOfBlock);
|
||||
c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
|
||||
qDebug() << "should display directed message, erasing last rx activity line..." << c.selectedText();
|
||||
c.deleteChar();
|
||||
c.deleteChar();
|
||||
}
|
||||
|
||||
// log it to the display!
|
||||
displayTextForFreq(ad.text, ad.freq, ad.utcTimestamp, false, true, false);
|
||||
}
|
||||
|
||||
// and mark the offset as a directed offset so future free text is displayed
|
||||
markOffsetDirected(ad.freq);
|
||||
@ -8910,7 +8936,7 @@ void MainWindow::displayBandActivity() {
|
||||
if (item.isLowConfidence) {
|
||||
item.text = QString("[%1]").arg(item.text);
|
||||
}
|
||||
if (item.bits == Varicode::FT8CallLast) {
|
||||
if ((item.bits & Varicode::FT8CallLast) == Varicode::FT8CallLast) {
|
||||
// can also use \u0004 \u2666 \u2404
|
||||
item.text = QString("%1 \u2301 ").arg(item.text);
|
||||
}
|
||||
@ -9038,11 +9064,12 @@ void MainWindow::displayCallActivity() {
|
||||
|
||||
void MainWindow::postWSPRDecode (bool is_new, QStringList parts)
|
||||
{
|
||||
if (parts.size () < 8)
|
||||
#if 0
|
||||
if (parts.size () < 8)
|
||||
{
|
||||
parts.insert (6, "");
|
||||
}
|
||||
#if 0
|
||||
|
||||
m_messageClient->WSPR_decode (is_new, QTime::fromString (parts[0], "hhmm"), parts[1].toInt ()
|
||||
, parts[2].toFloat (), Radio::frequency (parts[3].toFloat (), 6)
|
||||
, parts[4].toInt (), parts[5], parts[6], parts[7].toInt ()
|
||||
@ -9633,9 +9660,10 @@ void MainWindow::on_cbCQTx_toggled(bool b)
|
||||
|
||||
void MainWindow::statusUpdate () const
|
||||
{
|
||||
#if 0
|
||||
if (!ui) return;
|
||||
auto submode = current_submode ();
|
||||
#if 0
|
||||
|
||||
m_messageClient->status_update (m_freqNominal, m_mode, m_hisCall,
|
||||
QString::number (ui->rptSpinBox->value ()),
|
||||
m_modeTx, ui->autoButton->isChecked (),
|
||||
|
@ -133,7 +133,7 @@ public slots:
|
||||
void logCallActivity(CallDetail d, bool spot=true);
|
||||
QString lookupCallInCompoundCache(QString const &call);
|
||||
void clearActivity();
|
||||
void displayTextForFreq(QString text, int freq, QDateTime date, bool bold, bool newLine, bool clearLine);
|
||||
void displayTextForFreq(QString text, int freq, QDateTime date, bool isTx, bool isNewLine, bool isLast);
|
||||
int writeMessageTextToUI(QDateTime date, QString text, int freq, bool bold, int block=-1);
|
||||
void addMessageText(QString text, bool clear=false);
|
||||
void enqueueMessage(int priority, QString message, int freq, Callback c);
|
||||
@ -833,6 +833,7 @@ private:
|
||||
bool isAllCallIncluded(QString const &text);
|
||||
QString callsignSelected();
|
||||
bool isRecentOffset(int offset);
|
||||
void markOffsetRecent(int offset);
|
||||
bool isDirectedOffset(int offset);
|
||||
void markOffsetDirected(int offset);
|
||||
void processActivity(bool force=false);
|
||||
|
12
varicode.h
12
varicode.h
@ -16,14 +16,10 @@ class Varicode
|
||||
public:
|
||||
// frame type transmitted via itype and decoded by the ft8 decoded
|
||||
enum TransmissionType {
|
||||
FT8 = 0, // [000]
|
||||
FT8Fox = 1, // [001] <- the decoder special cases this one frequently :|
|
||||
FT8Call = 2, // [010]
|
||||
FT8CallLast = 3, // [011] <- used to indicate the last frame in a transmission
|
||||
FT8CallFirst = 4, // [100] <- used to indicate the first frmae in a transmission
|
||||
FT8CallReservedB = 5, // [101]
|
||||
FT8CallReservedC = 6, // [110]
|
||||
FT8CallReservedD = 7, // [111]
|
||||
FT8Call = 0, // [000] <- any other frame of the message
|
||||
FT8CallFirst = 1, // [001] <- the first frame of a message
|
||||
FT8CallLast = 2, // [010] <- the last frame of a message
|
||||
FT8CallReserved = 4, // [100] <- a reserved flag for future use...
|
||||
};
|
||||
|
||||
enum FrameType {
|
||||
|
Loading…
Reference in New Issue
Block a user