Add labels for Band Changes, Rate, and Score to the ActiveStations window.

This commit is contained in:
Joe Taylor 2022-03-26 16:15:04 -04:00
parent 3c3c450839
commit f43c1e97ae
5 changed files with 119 additions and 46 deletions

View File

@ -103,3 +103,18 @@ void ActiveStations::on_cbReadyOnly_toggled(bool b)
m_bReadyOnly=b;
emit activeStationsDisplay();
}
void ActiveStations::setRate(int n)
{
ui->rate->setText(QString::number(n));
}
void ActiveStations::setScore(int n)
{
ui->score->setText(QString::number(n));
}
void ActiveStations::setBandChanges(int n)
{
ui->bandChanges->setText(QString::number(n));
}

View File

@ -26,6 +26,9 @@ public:
void setClickOK(bool b);
void erase();
bool readyOnly();
void setRate(int n);
void setBandChanges(int n);
void setScore(int n);
Q_SLOT void select();
bool m_clickOK=false;

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>466</width>
<width>395</width>
<height>339</height>
</rect>
</property>
@ -18,7 +18,54 @@
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<item row="0" column="0">
<widget class="QSpinBox" name="sbMaxRecent">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set maximum number of displayed lines.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Max N </string>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLineEdit" name="rate">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Rate of score increase, points per hour.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="sbMaxAge">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -49,35 +96,37 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QSpinBox" name="sbMaxRecent">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="4">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Score:</string>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set maximum number of displayed lines.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Max N </string>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>10</number>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="4">
<widget class="QLabel" name="label">
<property name="text">
<string>Rate:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QLineEdit" name="score">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="cbReadyOnly">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Check to list only stations immediately ready to be called.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@ -87,23 +136,23 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label">
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Rate:</string>
<string>Band Changes:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLineEdit" name="lineEdit">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
<item row="1" column="2">
<widget class="QLineEdit" name="bandChanges">
<property name="text">
<string>0</string>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Rate of score increase, points per hour.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>

View File

@ -3464,7 +3464,6 @@ void MainWindow::ARRL_Digi_Display()
int az=m_activeCall[deCall].az;
deGrid=m_activeCall[deCall].grid4;
points=m_activeCall[deCall].points;
// qDebug() << "bb" << m_currentBand << deCall << bands;
if(points>maxPoints) maxPoints=points;
float x=float(age)/(maxAge+1);
if(x>1.0) x=0;
@ -3519,7 +3518,6 @@ void MainWindow::callSandP2(int n)
void MainWindow::activeWorked(QString call, QString band)
{
QString bands=m_activeCall[call].bands;
// qDebug() << "cc" << band << call << bands;
QByteArray ba=bands.toLatin1();
if(band=="160m") ba[0]='a';
if(band=="80m") ba[1]='b';
@ -3529,7 +3527,6 @@ void MainWindow::activeWorked(QString call, QString band)
if(band=="10m") ba[5]='f';
if(band=="6m") ba[6]='g';
m_activeCall[call].bands=QString::fromLatin1(ba);
// qDebug() << "dd" << band << call << m_activeCall[call].bands;
}
void MainWindow::readFromStdout() //readFromStdout
@ -3673,8 +3670,6 @@ void MainWindow::readFromStdout() //readFromStdout
decodedtext.deCallAndGrid(/*out*/deCall,deGrid);
bool bWorkedOnBand=(ui->decodedTextBrowser->CQPriority()!="New Call on Band") and ui->decodedTextBrowser->CQPriority()!="";
if(bWorkedOnBand) activeWorked(deCall,m_currentBand);
// qDebug() << "aa" << m_currentBand << deCall << bWorkedOnBand << m_activeCall[deCall].bands
// << ui->decodedTextBrowser->CQPriority();
}
if (m_config.highlight_DXcall () && (m_hisCall!="") && ((decodedtext.string().contains(QRegularExpression {"(\\w+) " + m_hisCall}))
@ -6233,6 +6228,8 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call,
, QString const& exchange_sent, QString const& exchange_rcvd
, QString const& propmode, QByteArray const& ADIF)
{
static QString lastBand{""};
static int nBandChanges{0};
QString date = QSO_date_on.toString("yyyyMMdd");
if (!m_logBook.add (call, grid, m_config.bands()->find(dial_freq), mode, ADIF))
{
@ -6265,7 +6262,16 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call,
ui->sbSerialNumber->setValue(ui->sbSerialNumber->value() + 1);
}
activeWorked(call,m_config.bands()->find(dial_freq));
QString band=m_config.bands()->find(dial_freq);
activeWorked(call,band);
int points=m_activeCall[call].points;
m_score += points;
if(band!=lastBand and lastBand!="") nBandChanges+=1;
lastBand=band;
m_ActiveStationsWidget->setRate(points);
m_ActiveStationsWidget->setScore(m_score);
m_ActiveStationsWidget->setBandChanges(nBandChanges);
m_xSent.clear ();
m_xRcvd.clear ();
if (m_config.clear_DXcall ()) ui->dxCallEntry->clear ();
@ -7601,7 +7607,6 @@ void MainWindow::transmit (double snr)
}
if((m_mode=="FT4" or m_mode=="FT8") and m_maxPoints>0 and SpecOp::ARRL_DIGI==m_config.special_op_id()) {
// qDebug() << "DD" << m_maxPoints << m_deCall << m_deGrid;
ui->dxCallEntry->setText(m_deCall);
ui->dxGridEntry->setText(m_deGrid);
genStdMsgs("-10");

View File

@ -495,6 +495,7 @@ private:
qint32 m_maxPoints=-1;
qint32 m_latestDecodeTime=-1;
qint32 m_points=-99;
qint32 m_score=0;
bool m_btxok; //True if OK to transmit
bool m_diskData;