mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-20 02:52:00 -05:00
fde1b213c3
2. Remove (or comment out) most qDebug() statements. 3. Swap positions of labels 2 and 3 on status bar. 4. In "Split Tx" mode, transmit audio always between 1500 and 2000 Hz. 5. Rearrange positions of WideGraph controls. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3535 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
72 lines
2.0 KiB
C++
72 lines
2.0 KiB
C++
#include "logbook.h"
|
|
|
|
|
|
void LogBook::init()
|
|
{
|
|
const QString logFilename = "wsjtx_log.adi"; //TODO get from user
|
|
const QString countryDataFilename = "cty.dat"; //TODO get from user
|
|
|
|
_countries.init(countryDataFilename);
|
|
_countries.load();
|
|
|
|
_worked.init(_countries.getCountryNames());
|
|
|
|
_log.init(logFilename);
|
|
_log.load();
|
|
|
|
_setAlreadyWorkedFromLog();
|
|
|
|
/*
|
|
int QSOcount = _log.getCount();
|
|
int count = _worked.getWorkedCount();
|
|
qDebug() << QSOcount << "QSOs and" << count << "countries worked in file" << logFilename;
|
|
*/
|
|
}
|
|
|
|
|
|
void LogBook::_setAlreadyWorkedFromLog()
|
|
{
|
|
QList<QString> calls = _log.getCallList();
|
|
QString c;
|
|
foreach(c,calls)
|
|
{
|
|
QString countryName = _countries.find(c);
|
|
if (countryName.length() > 0)
|
|
{
|
|
_worked.setAsWorked(countryName);
|
|
//qDebug() << countryName << " worked " << c;
|
|
}
|
|
}
|
|
}
|
|
|
|
void LogBook::match(/*in*/const QString call,
|
|
/*out*/ QString &countryName,
|
|
bool &callWorkedBefore,
|
|
bool &countryWorkedBefore)
|
|
{
|
|
if (call.length() > 0)
|
|
{
|
|
QString currentMode = "JT9"; // JT65 == JT9 in ADIF::match()
|
|
QString currentBand = ""; // match any band
|
|
callWorkedBefore = _log.match(call,currentBand,currentMode);
|
|
countryName = _countries.find(call);
|
|
if (countryName.length() > 0) // country was found
|
|
countryWorkedBefore = _worked.getHasWorked(countryName);
|
|
else
|
|
{
|
|
countryName = "where?"; //error: prefix not found
|
|
countryWorkedBefore = false;
|
|
}
|
|
}
|
|
qDebug() << "Logbook:" << call << ":" << countryName << "Cty B4:" << countryWorkedBefore << "call B4:" << callWorkedBefore;
|
|
}
|
|
|
|
void LogBook::addAsWorked(const QString call)
|
|
{
|
|
qDebug() << "adding " << call << " as worked";
|
|
_log.add(call);
|
|
QString countryName = _countries.find(call);
|
|
if (countryName.length() > 0)
|
|
_worked.setAsWorked(countryName);
|
|
}
|