mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-09-28 16:16:48 -04:00
Starting to implement worked-before logic for calls, grids, and DXCCs, by band (and perhaps by mode?).
This commit is contained in:
parent
cbfd1d0415
commit
1ed527c362
@ -905,6 +905,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
connect (&splashTimer, &QTimer::timeout, this, &MainWindow::splash_done);
|
connect (&splashTimer, &QTimer::timeout, this, &MainWindow::splash_done);
|
||||||
splashTimer.setSingleShot (true);
|
splashTimer.setSingleShot (true);
|
||||||
splashTimer.start (20 * 1000);
|
splashTimer.start (20 * 1000);
|
||||||
|
|
||||||
|
readLog(); //Read wsjtx.log
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(m_config.my_callsign()=="K1JT" or m_config.my_callsign()=="K9AN" or
|
if(m_config.my_callsign()=="K1JT" or m_config.my_callsign()=="K9AN" or
|
||||||
m_config.my_callsign()=="G4WJS" or
|
m_config.my_callsign()=="G4WJS" or
|
||||||
@ -981,6 +984,71 @@ void MainWindow::on_the_minute ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MainWindow::iband(float fMHz)
|
||||||
|
{
|
||||||
|
float f[]={0.1375,0.4755,1.9,3.75,5.3585,7.150,10.125,14.175,18.128,21.225,
|
||||||
|
24.940,28.850,52.0,70.25,146.0,435.0,915.0,1270.0,2375.,3400.,5787.,
|
||||||
|
10250.,24125.,47100.,78500.,122500.,137500.,246000.};
|
||||||
|
float x,xmin=1.0e30;
|
||||||
|
int ibest=-1;
|
||||||
|
for(int i=0; i<28; i++) {
|
||||||
|
x=qAbs(fMHz/f[i] - 1.0);
|
||||||
|
if(x < xmin) {
|
||||||
|
xmin=x;
|
||||||
|
ibest=i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qDebug() << "AA" << fMHz << ibest << xmin << hamBand(ibest);
|
||||||
|
return ibest;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MainWindow::hamBand(int iband)
|
||||||
|
{
|
||||||
|
QString b[]={"2200m","630m","160m","80m","60m","40m","30m","20m","17m","15m",
|
||||||
|
"12m","10m","6m","4m","2m","1.25m","70cm","33cm","23cm","13cm",
|
||||||
|
"6cm","3cm","1.25cm"};
|
||||||
|
if(iband<=23) {
|
||||||
|
return b[iband];
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::readLog()
|
||||||
|
{
|
||||||
|
QFile f(m_config.writeable_data_dir ().absoluteFilePath ("wsjtx.log"));
|
||||||
|
if(f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
|
QTextStream s(&f);
|
||||||
|
QString t0,t,callsign,grid,mode;
|
||||||
|
int nQSO=0; //Total number of QSOs
|
||||||
|
int i0,i1,i2,len;
|
||||||
|
float fMHz;
|
||||||
|
// Read the log
|
||||||
|
while(!s.atEnd()) {
|
||||||
|
t0=s.readLine().mid(40);
|
||||||
|
i0=t0.indexOf(",");
|
||||||
|
callsign=t0.left(i0);
|
||||||
|
t=t0.mid(i0+1);
|
||||||
|
i0=t.indexOf(",");
|
||||||
|
grid=t.left(i0);
|
||||||
|
t=t.mid(i0+1);
|
||||||
|
i0=t.indexOf(",");
|
||||||
|
fMHz=t.left(i0).toFloat();
|
||||||
|
t=t.mid(i0+1);
|
||||||
|
i0=t.indexOf(",");
|
||||||
|
mode=t.left(i0);
|
||||||
|
nQSO++;
|
||||||
|
i1 = m_callWorked[callsign];
|
||||||
|
i2 = 1 << iband(fMHz);
|
||||||
|
m_callWorked[callsign]=i1 | i2;
|
||||||
|
if(MaidenheadLocatorValidator::Acceptable == MaidenheadLocatorValidator().validate(grid,len)) {
|
||||||
|
m_gridWorked[grid]=i1 | i2;
|
||||||
|
}
|
||||||
|
// qDebug() << nQSO << callsign << grid << fMHz << mode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------- MainWindow destructor
|
//--------------------------------------------------- MainWindow destructor
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
@ -3026,6 +3094,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
QString deCall;
|
QString deCall;
|
||||||
QString grid;
|
QString grid;
|
||||||
decodedtext.deCallAndGrid(/*out*/deCall,grid);
|
decodedtext.deCallAndGrid(/*out*/deCall,grid);
|
||||||
|
qDebug() << "bb" << deCall << grid << m_callWorked[deCall] << m_gridWorked[grid];
|
||||||
{
|
{
|
||||||
QString t=Radio::base_callsign(ui->dxCallEntry->text());
|
QString t=Radio::base_callsign(ui->dxCallEntry->text());
|
||||||
if((t==deCall or t=="") and rpt!="") m_rptRcvd=rpt;
|
if((t==deCall or t=="") and rpt!="") m_rptRcvd=rpt;
|
||||||
|
11
mainwindow.h
11
mainwindow.h
@ -544,6 +544,7 @@ private:
|
|||||||
QLabel watchdog_label;
|
QLabel watchdog_label;
|
||||||
|
|
||||||
QFuture<void> m_wav_future;
|
QFuture<void> m_wav_future;
|
||||||
|
QFuture<void> m_readLogFuture;
|
||||||
QFutureWatcher<void> m_wav_future_watcher;
|
QFutureWatcher<void> m_wav_future_watcher;
|
||||||
QFutureWatcher<void> watcher3;
|
QFutureWatcher<void> watcher3;
|
||||||
QFutureWatcher<QString> m_saveWAVWatcher;
|
QFutureWatcher<QString> m_saveWAVWatcher;
|
||||||
@ -612,6 +613,11 @@ private:
|
|||||||
QMap<QString,FoxQSO> m_foxQSO; //Key = HoundCall, value = parameters for QSO in progress
|
QMap<QString,FoxQSO> m_foxQSO; //Key = HoundCall, value = parameters for QSO in progress
|
||||||
QMap<QString,QString> m_loggedByFox; //Key = HoundCall, value = logged band
|
QMap<QString,QString> m_loggedByFox; //Key = HoundCall, value = logged band
|
||||||
|
|
||||||
|
QHash<QString,qint32> m_callWorked;
|
||||||
|
QHash<QString,qint32> m_gridWorked;
|
||||||
|
// QHash<QString,qint32> m_dxccWorked;
|
||||||
|
// QHash<QString,qint32> m_multWorked;
|
||||||
|
|
||||||
QQueue<QString> m_houndQueue; //Selected Hounds available for starting a QSO
|
QQueue<QString> m_houndQueue; //Selected Hounds available for starting a QSO
|
||||||
QQueue<QString> m_foxQSOinProgress; //QSOs in progress: Fox has sent a report
|
QQueue<QString> m_foxQSOinProgress; //QSOs in progress: Fox has sent a report
|
||||||
QQueue<qint64> m_foxRateQueue;
|
QQueue<qint64> m_foxRateQueue;
|
||||||
@ -689,6 +695,10 @@ private:
|
|||||||
void fast_config(bool b);
|
void fast_config(bool b);
|
||||||
void CQTxFreq();
|
void CQTxFreq();
|
||||||
void cabLog();
|
void cabLog();
|
||||||
|
void readLog();
|
||||||
|
int iband(float fMHz);
|
||||||
|
QString hamBand(int iband);
|
||||||
|
|
||||||
QString save_wave_file (QString const& name
|
QString save_wave_file (QString const& name
|
||||||
, short const * data
|
, short const * data
|
||||||
, int seconds
|
, int seconds
|
||||||
@ -732,5 +742,6 @@ extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
|
|||||||
int minChan[], int maxChan[],
|
int minChan[], int maxChan[],
|
||||||
int minSpeed[], int maxSpeed[]);
|
int minSpeed[], int maxSpeed[]);
|
||||||
extern int next_tx_state(int pctx);
|
extern int next_tx_state(int pctx);
|
||||||
|
//extern void readLog();
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user