Worked and Confirmed locators are now shown together in the map

This commit is contained in:
ea4k 2022-02-13 18:06:03 +01:00
parent 7bdde484eb
commit fb4701f032
7 changed files with 87 additions and 31 deletions

View File

@ -38,12 +38,15 @@ qmake src.pro
mingw32-make
mkdir release
xcopy /Y /S /F build\target release
windeployqt release\klog.exe
echo localdir=%cd%
echo %localdir%
copy ..\..\paquete\openssl\*.dll release
copy ..\..\paquete\hamlibDLL\*.dll release
windeployqt --qmldir qml release\klog.exe
:: The SSL DLLs must be included and must match the version that were used to build Qt.
:: Check in main.cpp and uncomment the SSL line to see what is the version that was used.
:: After knowing the version, the package can be obtained from: https://indy.fulgan.com/SSL/Archive/
copy ..\..\paquete\openssl\*.dll release
copy *.ico release
copy AUTHORS release
copy Changelog release

View File

@ -519,3 +519,25 @@ QStringList Locator::getAll(int _length)
}
return list;
}
QStringList Locator::getShortLocators(const QStringList &locators, const int _length)
{
QStringList shortLocators;
shortLocators.clear ();
foreach(QString i, locators)
{
if (i.length() == _length)
{
shortLocators << i;
}
else if (i.length()>_length)
{
QString a = i;
a.truncate(4);
shortLocators << a;
}
}
shortLocators.removeDuplicates();
shortLocators.sort();
return shortLocators;
}

View File

@ -65,6 +65,7 @@ public:
Coordinate getLocatorCorner (const QString& tlocator, bool northWest = true); //northWest = returns the Noth West corner, false implies South East
bool checkCoords(const double lon1, const double lat1);
QStringList getAll(int _length = 4); // Returns the list of All locators of the requested size, 4 as default
QStringList getShortLocators(const QStringList &locators, const int _length=4);
private:
//bool valid;

View File

@ -428,6 +428,7 @@ void MainWindow::init()
}
//qDebug() << "MainWindow::init - 70" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL;
mapWindow->init();
readConfigData();
//qDebug() << "MainWindow::init - 71" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL;
@ -478,7 +479,7 @@ void MainWindow::init()
infoWidget->showInfo(-1);
//qDebug() << Q_FUNC_INFO << " - 120";
//lotwTQSLpath = util->getTQSLsPath() + util->getTQSLsFileName();
mapWindow->init();
upAndRunning = true;
mainQSOEntryWidget->setUpAndRunning(upAndRunning);
//qDebug() << Q_FUNC_INFO << " - 130";
@ -4878,6 +4879,7 @@ void MainWindow::readConfigData()
configured = true;
searchWidget->setColors(newOneColor.name(), neededColor.name(), workedColor.name(), confirmedColor.name(), defaultColor.name());
awards->setColors (newOneColor.name(), neededColor.name(), workedColor.name(), confirmedColor.name(), defaultColor.name());
mapWindow->setColors (workedColor, confirmedColor, defaultColor);
dxClusterWidget->setColors (newOneColor.name(), neededColor.name(), workedColor.name(), confirmedColor.name(), defaultColor.name());
dxClusterWidget->setDXClusterSpotConfig(dxClusterShowHF, dxClusterShowVHF, dxClusterShowWARC, dxClusterShowWorked, dxClusterShowConfirmed, dxClusterShowAnn, dxClusterShowWWV, dxClusterShowWCY );
setMainWindowTitle();

View File

@ -119,6 +119,7 @@ void MapWidget::addLocator(const QString &_loc, const QColor &_color)
{
return;
}
qmlView.rootContext()->setContextProperty("rectangle_model", &modelRectangle);
Coordinate _north, _south;

View File

@ -52,8 +52,6 @@ MapWindowWidget::~MapWindowWidget()
void MapWindowWidget::init()
{
newOneColor = Qt::black;
neededColor = Qt::black;
workedColor = Qt::black;
confirmedColor = Qt::black;
defaultColor = Qt::black;
@ -62,7 +60,6 @@ void MapWindowWidget::init()
void MapWindowWidget::createUI()
{
bandComboBox->setToolTip(tr("Select QSOs in this band."));
modeComboBox->setToolTip(tr("Select QSOs in this mode."));
propComboBox->setToolTip(tr("Select QSOs in this propagation mode."));
@ -185,32 +182,55 @@ void MapWindowWidget::showFiltered()
{
color = workedColor;
}
color.setAlpha(127); // Little Transparent
color.setAlpha(127);// The alpha gives some transparency
QString satName = satNameComboBox->currentText();
locators << dataProxy->getFilteredLocators(bandComboBox->currentText(), modeComboBox->currentText(), getPropModeFromComboBox(), satName.section(' ', 0, 0), confirmedCheckBox->isChecked());
foreach(QString i, locators)
{
if (i.length() == 4)
{
shortLocators << i;
}
else if (i.length()>4)
{
QString a = i;
a.truncate(4);
shortLocators << a;
}
}
// Get Confirmed Locators
// Print Confirmed
// !only confirmed
// Get worked locators
// Remove confirmed from worked
// Print Worked
//locators << dataProxy->getFilteredLocators(bandComboBox->currentText(), modeComboBox->currentText(), getPropModeFromComboBox(), satName.section(' ', 0, 0), confirmedCheckBox->isChecked());
locators << dataProxy->getFilteredLocators(bandComboBox->currentText(), modeComboBox->currentText(), getPropModeFromComboBox(), satName.section(' ', 0, 0), true);
Locator locator;
shortLocators << locator.getShortLocators (locators);
shortLocators << locators;
shortLocators.removeDuplicates();
shortLocators.sort();
addLocators(shortLocators, confirmedColor);
addLocators(shortLocators, color);
if (!confirmedCheckBox->isChecked ())
{
QStringList wLocators;
wLocators.clear ();
wLocators << dataProxy->getFilteredLocators(bandComboBox->currentText(), modeComboBox->currentText(), getPropModeFromComboBox(), satName.section(' ', 0, 0), false);
QStringList workedLocators;
workedLocators.clear ();
foreach (QString loc, wLocators)
{
if (!shortLocators.contains (loc))
{
workedLocators.append (loc);
}
}
shortLocators.clear();
shortLocators << locator.getShortLocators (workedLocators);
shortLocators << workedLocators;
shortLocators.removeDuplicates();
shortLocators.sort();
appendLocators(shortLocators, workedColor);
}
}
void MapWindowWidget::slotBandsComboBoxChanged()
{
//qDebug() << Q_FUNC_INFO;
@ -289,6 +309,15 @@ void MapWindowWidget::addLocators(const QStringList &_locators, const QColor &_c
}
}
void MapWindowWidget::appendLocators(const QStringList &_locators, const QColor &_color)
{
foreach(QString i, _locators)
{
//mapWidget->addLocator(i, confirmedColor);
mapWidget->addLocator(i, _color);
}
}
QString MapWindowWidget::getPropModeFromComboBox()
{
QString _pm = QString();
@ -309,12 +338,9 @@ void MapWindowWidget::paintGlobalGrid()
}
void MapWindowWidget::setColors (const QColor &_newOne, const QColor &_needed, const QColor &_worked, const QColor &_confirmed, const QColor &_default)
void MapWindowWidget::setColors (const QColor &_worked, const QColor &_confirmed, const QColor &_default)
{
//qDebug() << "Awards::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << QT_ENDL;
defaultColor = _default;
neededColor = _needed;
workedColor = _worked;
confirmedColor = _confirmed;
newOneColor = _newOne;
}

View File

@ -31,6 +31,7 @@
#include "klogdefinitions.h"
#include "mapwidget.h"
#include "dataproxy_sqlite.h"
#include "locator.h"
class MapWindowWidget : public QWidget
{
@ -46,7 +47,8 @@ public:
void addQSO(const QString &_loc);
void addLocator(const QString &_loc, const QColor &_color);
void addLocators(const QStringList &_locators, const QColor &_color);
void setColors (const QColor &_newOne, const QColor &_needed, const QColor &_worked, const QColor &_confirmed, const QColor &_default);
void appendLocators(const QStringList &_locators, const QColor &_color);
void setColors (const QColor &_worked, const QColor &_confirmed, const QColor &_default);
private slots:
void slotBandsComboBoxChanged();
@ -62,6 +64,7 @@ private:
void setPropModes();
void setSatNames();
void showFiltered();
QString getShortLocators (const int _length);
QString getPropModeFromComboBox();
DataProxy_SQLite *dataProxy;
@ -69,10 +72,8 @@ private:
QComboBox *propComboBox, *bandComboBox, *modeComboBox, *satNameComboBox;
QCheckBox *confirmedCheckBox;//, *locatorsCheckBox;
QColor newOneColor; //
QColor neededColor; //
QColor workedColor; //
QColor confirmedColor; //
QColor workedColor;
QColor confirmedColor;
QColor defaultColor;
};