Working on the Fox GUI.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8214 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-11-03 18:27:46 +00:00
parent 25ffeb2eb5
commit c9e9de2ea0
4 changed files with 48 additions and 4 deletions

View File

@ -237,3 +237,8 @@ void DisplayText::displayQSY(QString text)
QString t = QDateTime::currentDateTimeUtc().toString("hhmmss") + " " + text;
appendText (t, "hotpink");
}
void DisplayText::displayFoxToBeCalled(QString t, QColor bg)
{
appendText(t,bg);
}

View File

@ -25,6 +25,7 @@ public:
void displayTransmittedText(QString text, QString modeTx, qint32 txFreq,
QColor color_TxMsg, bool bFastMode);
void displayQSY(QString text);
void displayFoxToBeCalled(QString t, QColor bg);
Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers);
Q_SIGNAL void erased ();

View File

@ -871,6 +871,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_min_dB=-30;
m_max_dB=30;
m_CQtype="CQ";
m_toBeCalled="";
if(m_mode.startsWith ("WSPR") and m_pctx>0) {
QPalette palette {ui->sbTxPercent->palette ()};
@ -1713,6 +1714,12 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
case Qt::Key_8:
if(m_isort<4) m_isort++;
return;
case Qt::Key_Return:
doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier));
return;
case Qt::Key_Enter:
doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier));
return;
}
QMainWindow::keyPressEvent (e);
@ -2730,6 +2737,7 @@ void MainWindow::decodeDone ()
QString t=s.readAll();
QString t1=sortFoxCalls(t,m_isort,m_max_N,m_min_dB,m_max_dB);
ui->decodedTextBrowser->setText(t1);
if(m_toBeCalled!="") ui->decodedTextBrowser->displayFoxToBeCalled(m_toBeCalled,"#ff99ff");
}
}
}
@ -3784,8 +3792,15 @@ void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
} else {
cursor=ui->decodedTextBrowser2->textCursor();
}
cursor.setPosition (cursor.selectionStart());
if(modifiers==(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)) {
cursor.setPosition(0);
} else {
cursor.setPosition(cursor.selectionStart());
}
if(m_config.bFox() and m_decodedText2) {
if(m_nToBeCalled >= 4) return;
QString t=cursor.block().text();
QString c2=t.split(" ",QString::SkipEmptyParts).at(0);
QString g2=t.split(" ",QString::SkipEmptyParts).at(1);
@ -3793,6 +3808,14 @@ void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
ui->dxCallEntry->setText(c2);
ui->dxGridEntry->setText(g2);
genStdMsgs(rpt);
on_txb2_clicked();
m_FoxCallers=m_FoxCallers.remove(t+"\n");
if(m_toBeCalled.length()>0) m_toBeCalled += "\n";
m_toBeCalled += t;
m_nToBeCalled+=1;
ui->decodedTextBrowser->clear();
ui->decodedTextBrowser->append(m_FoxCallers);
ui->decodedTextBrowser->displayFoxToBeCalled(m_toBeCalled,"#ff99ff");
return;
}
DecodedText message {cursor.block().text(), ("MSK144" == m_mode || "FT8" == m_mode) &&
@ -4775,13 +4798,18 @@ void MainWindow::on_actionFT8_triggered()
m_TRperiod=15;
m_fastGraph->hide();
m_wideGraph->show();
ui->decodedTextLabel->setText( " UTC dB DT Freq Message");
ui->decodedTextLabel2->setText(" UTC dB DT Freq Message");
m_wideGraph->setPeriod(m_TRperiod,m_nsps);
m_modulator->setPeriod(m_TRperiod); // TODO - not thread safe
m_detector->setPeriod(m_TRperiod); // TODO - not thread safe
ui->label_6->setText("Band Activity");
ui->label_7->setText("Rx Frequency");
if(m_config.bFox()) {
ui->label_6->setText("Stations calling DXpedition " + m_config.my_callsign());
ui->decodedTextLabel->setText( "Call Grid dB Freq Age");
} else {
ui->label_6->setText("Band Activity");
ui->decodedTextLabel->setText( " UTC dB DT Freq Message");
}
displayWidgets(nWidgets("111010000100111000010000"));
if(m_config.bFox() or m_config.bHound()) {
if(m_config.bFox()) ui->labDXped->setText("DXpedition: Fox");
@ -4792,6 +4820,8 @@ void MainWindow::on_actionFT8_triggered()
ui->labDXped->setVisible(false);
ui->cbVHFcontest->setVisible(true);
}
statusChanged();
}
@ -7022,5 +7052,9 @@ QString MainWindow::sortFoxCalls(QString t, int isort, int max_N, int min_dB, in
// QString uniqueCalls;
// uniqueCalls.sprintf(" Unique callers: %d",j);
// ui->labCallers->setText(uniqueCalls);
return t;
int i0=t.indexOf("\n") + 1;
m_nFoxCallers=qMin(t.length(),m_max_N*i0)/i0;
m_FoxCallers=t.mid(0,m_max_N*i0);
return m_FoxCallers;
}

View File

@ -411,6 +411,8 @@ private:
qint32 m_max_N;
qint32 m_max_dB;
qint32 m_min_dB;
qint32 m_nFoxCallers=0;
qint32 m_nToBeCalled=0;
bool m_btxok; //True if OK to transmit
bool m_diskData;
@ -547,6 +549,8 @@ private:
QString m_fileToSave;
QString m_calls;
QString m_CQtype;
QString m_FoxCallers;
QString m_toBeCalled;
QSet<QString> m_pfx;
QSet<QString> m_sfx;