Now have two decoded text boxes: left for decodes at QSO frequency, right

for everything else.
NB: I have screwed up the vertical expansion of mainwindow: growth occurs
at the bottom, rather than in the text boxes.  Help!


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3129 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-04-04 00:09:25 +00:00
parent c5bd47a9cd
commit 4a9ea17e5f
3 changed files with 1708 additions and 1630 deletions

View File

@ -79,6 +79,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int))); connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int)));
connect(ui->decodedTextBrowser,SIGNAL(selectCallsign(bool,bool)),this, connect(ui->decodedTextBrowser,SIGNAL(selectCallsign(bool,bool)),this,
SLOT(doubleClickOnCall(bool,bool))); SLOT(doubleClickOnCall(bool,bool)));
connect(ui->decodedTextBrowser2,SIGNAL(selectCallsign(bool,bool)),this,
SLOT(doubleClickOnCall2(bool,bool)));
setWindowTitle(Program_Title_Version); setWindowTitle(Program_Title_Version);
connect(&soundInThread, SIGNAL(readyForFFT(int)), connect(&soundInThread, SIGNAL(readyForFFT(int)),
@ -164,7 +166,9 @@ MainWindow::MainWindow(QWidget *parent) :
m_clearCallGrid=false; m_clearCallGrid=false;
m_bMiles=false; m_bMiles=false;
m_fMin=1000; m_fMin=1000;
m_decodedText2=false;
ui->fMinSpinBox->setValue(m_fMin); ui->fMinSpinBox->setValue(m_fMin);
decodeBusy(false); decodeBusy(false);
ui->xThermo->setFillBrush(Qt::green); ui->xThermo->setFillBrush(Qt::green);
@ -264,8 +268,11 @@ MainWindow::MainWindow(QWidget *parent) :
if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); if(ui->actionBlue->isChecked()) on_actionBlue_triggered();
ui->decodedTextLabel->setFont(ui->decodedTextBrowser->font()); ui->decodedTextLabel->setFont(ui->decodedTextBrowser->font());
// 2241 10 -8 0.2 1184. 0 VK7XX N1ISA FN41 ui->decodedTextLabel->setFont(ui->decodedTextBrowser2->font());
ui->decodedTextLabel->setText("UTC Sync dB DT Freq Drift Message"); // 2022 0 0.1 1446 W5NZ EA6BB JM19
t="UTC dB DT Freq Message";
t=t + " " + t;
ui->decodedTextLabel->setText(t);
#ifdef WIN32 #ifdef WIN32
if(m_pskReporter) { if(m_pskReporter) {
@ -1177,15 +1184,25 @@ void MainWindow::readFromStdout() //readFromStdout
QString bg="white"; QString bg="white";
if(t.indexOf(" CQ ")>0) bg="#66ff66"; //Light green if(t.indexOf(" CQ ")>0) bg="#66ff66"; //Light green
if(m_myCall!="" and t.indexOf(" "+m_myCall+" ")>0) bg="#ff6666"; //Light red if(m_myCall!="" and t.indexOf(" "+m_myCall+" ")>0) bg="#ff6666"; //Light red
bool bQSO=abs(t.mid(22,4).toInt() - g_pWideGraph->QSOfreq()) < 10;
QString t1=t.mid(0,5) + t.mid(10,4) + t.mid(15,5) + t.mid(22,4) +
t.mid(32);
QString s = "<table border=0 cellspacing=0 width=100%><tr><td bgcolor=\"" + QString s = "<table border=0 cellspacing=0 width=100%><tr><td bgcolor=\"" +
bg + "\"><pre>" + t.replace("\n","") + "</pre></td></tr></table>"; bg + "\"><pre>" + t1.replace("\n","") + "</pre></td></tr></table>";
if(bQSO) {
cursor = ui->decodedTextBrowser->textCursor(); cursor = ui->decodedTextBrowser->textCursor();
cursor.movePosition(QTextCursor::End); cursor.movePosition(QTextCursor::End);
bf = cursor.blockFormat(); bf = cursor.blockFormat();
bf.setBackground(QBrush(QColor(bg))); bf.setBackground(QBrush(QColor(bg)));
cursor.insertHtml(s); cursor.insertHtml(s);
ui->decodedTextBrowser->setTextCursor(cursor); ui->decodedTextBrowser->setTextCursor(cursor);
}
cursor = ui->decodedTextBrowser2->textCursor();
cursor.movePosition(QTextCursor::End);
bf = cursor.blockFormat();
bf.setBackground(QBrush(QColor(bg)));
cursor.insertHtml(s);
ui->decodedTextBrowser2->setTextCursor(cursor);
QString msg=t.mid(34,22); QString msg=t.mid(34,22);
bool b=stdmsg_(msg.toAscii().constData(),22); bool b=stdmsg_(msg.toAscii().constData(),22);
@ -1253,6 +1270,7 @@ void MainWindow::readFromStdout() //readFromStdout
void MainWindow::on_EraseButton_clicked() //Erase void MainWindow::on_EraseButton_clicked() //Erase
{ {
ui->decodedTextBrowser->clear(); ui->decodedTextBrowser->clear();
ui->decodedTextBrowser2->clear();
} }
void MainWindow::decodeBusy(bool b) //decodeBusy() void MainWindow::decodeBusy(bool b) //decodeBusy()
@ -1620,33 +1638,45 @@ void MainWindow::on_txb6_clicked() //txb6
m_restart=true; m_restart=true;
} }
void MainWindow::doubleClickOnCall2(bool shift, bool ctrl)
{
m_decodedText2=true;
doubleClickOnCall(shift,ctrl);
m_decodedText2=false;
}
void MainWindow::doubleClickOnCall(bool shift, bool ctrl) void MainWindow::doubleClickOnCall(bool shift, bool ctrl)
{ {
QTextCursor cursor=ui->decodedTextBrowser->textCursor(); QTextCursor cursor;
if(!m_decodedText2) cursor=ui->decodedTextBrowser->textCursor();
if(m_decodedText2) cursor=ui->decodedTextBrowser2->textCursor();
cursor.select(QTextCursor::LineUnderCursor); cursor.select(QTextCursor::LineUnderCursor);
int i2=cursor.position(); int i2=cursor.position();
QString t = ui->decodedTextBrowser->toPlainText(); //Full contents
QString t;
if(!m_decodedText2) t= ui->decodedTextBrowser->toPlainText(); //Full contents
if(m_decodedText2) t= ui->decodedTextBrowser2->toPlainText();
QString t1 = t.mid(0,i2); //contents up to \n on selected line QString t1 = t.mid(0,i2); //contents up to \n on selected line
int i1=t1.lastIndexOf("\n") + 1; //points to first char of line int i1=t1.lastIndexOf("\n") + 1; //points to first char of line
QString t2 = t1.mid(i1,i2-i1); //selected line QString t2 = t1.mid(i1,i2-i1); //selected line
int i4=t.mid(i1).length(); int i4=t.mid(i1).length();
if(i4>60) i4=60; if(i4>55) i4=55;
QString t3=t.mid(i1,i4); QString t3=t.mid(i1,i4);
int i5=t3.indexOf(" CQ DX "); int i5=t3.indexOf(" CQ DX ");
if(i5>0) t3=t3.mid(0,i5+3) + "_" + t3.mid(i5+4); //Make it "CQ_DX" (one word) if(i5>0) t3=t3.mid(0,i5+3) + "_" + t3.mid(i5+4); //Make it "CQ_DX" (one word)
QStringList t4=t3.split(" ",QString::SkipEmptyParts); QStringList t4=t3.split(" ",QString::SkipEmptyParts);
if(t4.length() <7) return; //Skip the rest if no decoded text if(t4.length() <5) return; //Skip the rest if no decoded text
QString firstcall=t4.at(6); QString firstcall=t4.at(4);
//Don't change freqs if Shift key down or a station is calling me. //Don't change freqs if Shift key down or a station is calling me.
if(!shift and (firstcall!=m_myCall or ctrl)) { if(!shift and (firstcall!=m_myCall or ctrl)) {
int nfreq=int(t4.at(4).toFloat()); int nfreq=int(t4.at(3).toFloat());
ui->TxFreqSpinBox->setValue(nfreq); ui->TxFreqSpinBox->setValue(nfreq);
g_pWideGraph->setQSOfreq(nfreq); g_pWideGraph->setQSOfreq(nfreq);
} }
QString hiscall=t4.at(7); QString hiscall=t4.at(5);
QString hisgrid=""; QString hisgrid="";
if(t4.length()>=9) if(t4.length()>=7)
hisgrid=t4.at(8); hisgrid=t4.at(6);
ui->dxCallEntry->setText(hiscall); ui->dxCallEntry->setText(hiscall);
lookup(); lookup();
if(ui->dxGridEntry->text()=="" and gridOK(hisgrid)) if(ui->dxGridEntry->text()=="" and gridOK(hisgrid))
@ -1655,7 +1685,7 @@ void MainWindow::doubleClickOnCall(bool shift, bool ctrl)
int nmod=n%(m_TRperiod/30); int nmod=n%(m_TRperiod/30);
m_txFirst=(nmod!=0); m_txFirst=(nmod!=0);
ui->txFirstCheckBox->setChecked(m_txFirst); ui->txFirstCheckBox->setChecked(m_txFirst);
QString rpt=t4.at(2); QString rpt=t4.at(1);
if(rpt.indexOf(" ")==0) rpt="+" + rpt.mid(2,2); if(rpt.indexOf(" ")==0) rpt="+" + rpt.mid(2,2);
if(rpt.indexOf(" -")==0) rpt=rpt.mid(1,2); if(rpt.indexOf(" -")==0) rpt=rpt.mid(1,2);
if(rpt.indexOf(" ")==0) rpt="+" + rpt.mid(1,2); if(rpt.indexOf(" ")==0) rpt="+" + rpt.mid(1,2);

View File

@ -33,6 +33,7 @@ public slots:
void freezeDecode(int n); void freezeDecode(int n);
void guiUpdate(); void guiUpdate();
void doubleClickOnCall(bool shift, bool ctrl); void doubleClickOnCall(bool shift, bool ctrl);
void doubleClickOnCall2(bool shift, bool ctrl);
void readFromStdout(); void readFromStdout();
void readFromStderr(); void readFromStderr();
void jt9_error(); void jt9_error();
@ -220,6 +221,7 @@ private:
bool m_insertBlank; bool m_insertBlank;
bool m_clearCallGrid; bool m_clearCallGrid;
bool m_bMiles; bool m_bMiles;
bool m_decodedText2;
char m_decoded[80]; char m_decoded[80];

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>680</width> <width>750</width>
<height>475</height> <height>535</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -18,13 +18,13 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>680</width> <width>690</width>
<height>475</height> <height>475</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>680</width> <width>750</width>
<height>1028</height> <height>1028</height>
</size> </size>
</property> </property>
@ -35,11 +35,16 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<widget class="QWidget" name="centralWidget"> <widget class="QWidget" name="centralWidget">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>11</y>
<width>730</width>
<height>480</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QLabel" name="decodedTextLabel"> <widget class="QLabel" name="decodedTextLabel">
<property name="minimumSize"> <property name="minimumSize">
@ -122,30 +127,32 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>UTC Sync dB DT Freq Dr </string> <string>UTC dB DT Freq Dr </string>
</property> </property>
<property name="indent"> <property name="indent">
<number>5</number> <number>5</number>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="DisplayText" name="decodedTextBrowser"> <widget class="DisplayText" name="decodedTextBrowser">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>421</width> <width>360</width>
<height>100</height> <height>100</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>1000</width> <width>360</width>
<height>1000</height> <height>1000</height>
</size> </size>
</property> </property>
@ -162,7 +169,7 @@
<enum>Qt::ScrollBarAlwaysOn</enum> <enum>Qt::ScrollBarAlwaysOn</enum>
</property> </property>
<property name="horizontalScrollBarPolicy"> <property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="html"> <property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
@ -179,6 +186,40 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="DisplayText" name="decodedTextBrowser2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>360</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>360</width>
<height>1000</height>
</size>
</property>
<property name="font">
<font>
<family>Courier New</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -328,14 +369,14 @@ p, li { white-space: pre-wrap; }
<item row="3" column="9"> <item row="3" column="9">
<widget class="QLineEdit" name="tx3"> <widget class="QLineEdit" name="tx3">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>160</horstretch> <horstretch>200</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>200</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
@ -444,6 +485,12 @@ p, li { white-space: pre-wrap; }
</item> </item>
<item row="5" column="7" rowspan="2"> <item row="5" column="7" rowspan="2">
<widget class="QFrame" name="frame_2"> <widget class="QFrame" name="frame_2">
<property name="minimumSize">
<size>
<width>107</width>
<height>0</height>
</size>
</property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>100</width>
@ -621,7 +668,7 @@ p, li { white-space: pre-wrap; }
<widget class="QFrame" name="frame"> <widget class="QFrame" name="frame">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>107</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -693,10 +740,10 @@ p, li { white-space: pre-wrap; }
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Plain</enum>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <property name="spacing">
@ -832,14 +879,14 @@ p, li { white-space: pre-wrap; }
<item row="6" column="9"> <item row="6" column="9">
<widget class="QLineEdit" name="tx6"> <widget class="QLineEdit" name="tx6">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>160</horstretch> <horstretch>200</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>200</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
@ -1024,14 +1071,14 @@ p, li { white-space: pre-wrap; }
<item row="1" column="9"> <item row="1" column="9">
<widget class="QLineEdit" name="tx1"> <widget class="QLineEdit" name="tx1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>160</horstretch> <horstretch>200</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>200</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
@ -1139,14 +1186,14 @@ p, li { white-space: pre-wrap; }
<item row="5" column="9"> <item row="5" column="9">
<widget class="QLineEdit" name="tx5"> <widget class="QLineEdit" name="tx5">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>160</horstretch> <horstretch>200</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>200</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
@ -1155,14 +1202,14 @@ p, li { white-space: pre-wrap; }
<item row="4" column="9"> <item row="4" column="9">
<widget class="QLineEdit" name="tx4"> <widget class="QLineEdit" name="tx4">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>160</horstretch> <horstretch>200</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>200</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
@ -1184,14 +1231,14 @@ p, li { white-space: pre-wrap; }
<item row="2" column="9"> <item row="2" column="9">
<widget class="QLineEdit" name="tx2"> <widget class="QLineEdit" name="tx2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>160</horstretch> <horstretch>200</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>200</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
@ -1200,14 +1247,14 @@ p, li { white-space: pre-wrap; }
<item row="0" column="9"> <item row="0" column="9">
<widget class="QPushButton" name="genStdMsgsPushButton"> <widget class="QPushButton" name="genStdMsgsPushButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>200</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>200</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -1677,15 +1724,14 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</item> </item>
</layout> </layout>
</item> </widget>
</layout>
</widget> </widget>
<widget class="QMenuBar" name="menuBar"> <widget class="QMenuBar" name="menuBar">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>680</width> <width>750</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>