mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-08-07 00:12:32 -04:00
More work on the ActiveStations features.
This commit is contained in:
parent
f3bac687ba
commit
5668e74f61
@ -3,6 +3,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCharFormat>
|
#include <QTextCharFormat>
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
#include "SettingsGroup.hpp"
|
#include "SettingsGroup.hpp"
|
||||||
#include "qt_helpers.hpp"
|
#include "qt_helpers.hpp"
|
||||||
@ -20,7 +21,7 @@ ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget
|
|||||||
ui->RecentStationsPlainTextEdit->setReadOnly (true);
|
ui->RecentStationsPlainTextEdit->setReadOnly (true);
|
||||||
changeFont (font);
|
changeFont (font);
|
||||||
read_settings ();
|
read_settings ();
|
||||||
ui->header_label2->setText(" Call Grid Age Points");
|
ui->header_label2->setText(" N Call Grid Tx Age Points");
|
||||||
connect(ui->RecentStationsPlainTextEdit, &QPlainTextEdit::selectionChanged, this, select);
|
connect(ui->RecentStationsPlainTextEdit, &QPlainTextEdit::selectionChanged, this, select);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,6 +70,9 @@ int ActiveStations::maxAge()
|
|||||||
|
|
||||||
void ActiveStations::select()
|
void ActiveStations::select()
|
||||||
{
|
{
|
||||||
|
qint64 msec=QDateTime::currentMSecsSinceEpoch();
|
||||||
|
if((msec-m_msec0)<500) return;
|
||||||
|
m_msec0=msec;
|
||||||
int nline=ui->RecentStationsPlainTextEdit->textCursor().blockNumber();
|
int nline=ui->RecentStationsPlainTextEdit->textCursor().blockNumber();
|
||||||
emit callSandP(nline);
|
emit callSandP(nline);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,8 @@ signals:
|
|||||||
private:
|
private:
|
||||||
void read_settings ();
|
void read_settings ();
|
||||||
void write_settings ();
|
void write_settings ();
|
||||||
// void setContentFont (QFont const&);
|
|
||||||
|
qint64 m_msec0=0;
|
||||||
QSettings * settings_;
|
QSettings * settings_;
|
||||||
|
|
||||||
QScopedPointer<Ui::ActiveStations> ui;
|
QScopedPointer<Ui::ActiveStations> ui;
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<string>Max Age </string>
|
<string>Max Age </string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>4</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
@ -64,7 +64,7 @@
|
|||||||
<string>Max Recent </string>
|
<string>Max Recent </string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>20</number>
|
<number>50</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
|
@ -3402,6 +3402,7 @@ void MainWindow::ARRL_Digi_Update(DecodedText dt)
|
|||||||
rc.audioFreq=dt.frequencyOffset();
|
rc.audioFreq=dt.frequencyOffset();
|
||||||
rc.snr=dt.snr();
|
rc.snr=dt.snr();
|
||||||
m_latestDecodeTime=dt.timeInSeconds();
|
m_latestDecodeTime=dt.timeInSeconds();
|
||||||
|
rc.txEven = (m_latestDecodeTime % int(2*m_TRperiod)) > 0;
|
||||||
rc.ready2call=false;
|
rc.ready2call=false;
|
||||||
bool bCQ=dt.messageWords()[0].left(3)=="CQ ";
|
bool bCQ=dt.messageWords()[0].left(3)=="CQ ";
|
||||||
if(bCQ or deGrid=="RR73" or deGrid=="73") rc.ready2call=true;
|
if(bCQ or deGrid=="RR73" or deGrid=="73") rc.ready2call=true;
|
||||||
@ -3427,8 +3428,10 @@ void MainWindow::ARRL_Digi_Display()
|
|||||||
icall.next();
|
icall.next();
|
||||||
deCall=icall.key();
|
deCall=icall.key();
|
||||||
age=int((m_latestDecodeTime - icall.value().decodeTime)/m_TRperiod + 0.5);
|
age=int((m_latestDecodeTime - icall.value().decodeTime)/m_TRperiod + 0.5);
|
||||||
|
int itx=1;
|
||||||
|
if(icall.value().txEven) itx=0;
|
||||||
if(age>maxAge) {
|
if(age>maxAge) {
|
||||||
// qDebug() << "bb" << i << deCall << "removed";
|
qDebug() << "bb" << i << deCall << "removed";
|
||||||
icall.remove();
|
icall.remove();
|
||||||
} else {
|
} else {
|
||||||
i++;
|
i++;
|
||||||
@ -3436,7 +3439,7 @@ void MainWindow::ARRL_Digi_Display()
|
|||||||
if(points>maxPoints) maxPoints=points;
|
if(points>maxPoints) maxPoints=points;
|
||||||
pts[i-1]=points - float(age)/(maxAge+1);
|
pts[i-1]=points - float(age)/(maxAge+1);
|
||||||
QString t1;
|
QString t1;
|
||||||
t1 = t1.asprintf(" %2d %5d",age,points);
|
t1 = t1.asprintf(" %2d %2d %5d",itx,age,points);
|
||||||
t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1;
|
t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1;
|
||||||
list.append(t1);
|
list.append(t1);
|
||||||
}
|
}
|
||||||
@ -3449,15 +3452,17 @@ void MainWindow::ARRL_Digi_Display()
|
|||||||
int k=indx[j]-1;
|
int k=indx[j]-1;
|
||||||
m_ready2call[i]=list[k];
|
m_ready2call[i]=list[k];
|
||||||
i++;
|
i++;
|
||||||
t += (list[k] + "\n");
|
QString t1=QString::number(i) + ". ";
|
||||||
|
if(i<10) t1=" " + t1;
|
||||||
|
t += (t1 + list[k] + "\n");
|
||||||
}
|
}
|
||||||
if(m_ActiveStationsWidget!=NULL) m_ActiveStationsWidget->displayRecentStations(t);
|
if(m_ActiveStationsWidget!=NULL) m_ActiveStationsWidget->displayRecentStations(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::callSandP2(int n)
|
void MainWindow::callSandP2(int n)
|
||||||
{
|
{
|
||||||
|
if(m_ready2call[n]=="") return;
|
||||||
QStringList w=m_ready2call[n].split(' ', SkipEmptyParts);
|
QStringList w=m_ready2call[n].split(' ', SkipEmptyParts);
|
||||||
|
|
||||||
m_deCall=w[0]; //### needed?
|
m_deCall=w[0]; //### needed?
|
||||||
m_deGrid=w[1]; //### needed?
|
m_deGrid=w[1]; //### needed?
|
||||||
m_bDoubleClicked=true; //### needed?
|
m_bDoubleClicked=true; //### needed?
|
||||||
@ -3465,8 +3470,10 @@ void MainWindow::callSandP2(int n)
|
|||||||
ui->dxGridEntry->setText(m_deGrid);
|
ui->dxGridEntry->setText(m_deGrid);
|
||||||
genStdMsgs("-10"); //### real SNR would be better here?
|
genStdMsgs("-10"); //### real SNR would be better here?
|
||||||
setTxMsg(3);
|
setTxMsg(3);
|
||||||
|
m_txFirst = (w[2]=="0");
|
||||||
|
ui->txFirstCheckBox->setChecked(m_txFirst);
|
||||||
if (!ui->autoButton->isChecked()) ui->autoButton->click(); // Enable Tx
|
if (!ui->autoButton->isChecked()) ui->autoButton->click(); // Enable Tx
|
||||||
|
if(m_transmitting) m_restart=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::readFromStdout() //readFromStdout
|
void MainWindow::readFromStdout() //readFromStdout
|
||||||
|
@ -648,7 +648,7 @@ private:
|
|||||||
QString m_BestCQpriority;
|
QString m_BestCQpriority;
|
||||||
QString m_deCall;
|
QString m_deCall;
|
||||||
QString m_deGrid;
|
QString m_deGrid;
|
||||||
QString m_ready2call[20];
|
QString m_ready2call[50];
|
||||||
|
|
||||||
QSet<QString> m_pfx;
|
QSet<QString> m_pfx;
|
||||||
QSet<QString> m_sfx;
|
QSet<QString> m_sfx;
|
||||||
@ -690,6 +690,7 @@ private:
|
|||||||
qint32 audioFreq;
|
qint32 audioFreq;
|
||||||
qint32 snr;
|
qint32 snr;
|
||||||
qint32 decodeTime;
|
qint32 decodeTime;
|
||||||
|
bool txEven;
|
||||||
bool ready2call;
|
bool ready2call;
|
||||||
};
|
};
|
||||||
QMap<QString,RecentCall> m_recentCall; //Key = callsign, value = snr, dialFreq, audioFreq, decodeTime
|
QMap<QString,RecentCall> m_recentCall; //Key = callsign, value = snr, dialFreq, audioFreq, decodeTime
|
||||||
|
Loading…
x
Reference in New Issue
Block a user