mirror of https://github.com/f4exb/sdrangel.git
Compare commits
6 Commits
0cc0aebc01
...
22e1762a28
Author | SHA1 | Date |
---|---|---|
dforsi | 22e1762a28 | |
Edouard Griffiths | 3795b72855 | |
srcejon | 0dcc4755ef | |
srcejon | 002c824dd9 | |
Daniele Forsi | b60eb5513d | |
Daniele Forsi | d09ee2d1f8 |
|
@ -4802,6 +4802,25 @@ void ADSBDemodGUI::applyMapSettings()
|
|||
// Restore position of map
|
||||
if (newMap != nullptr)
|
||||
{
|
||||
// Move antenna icon to My Position
|
||||
QObject *stationObject = newMap->findChild<QObject*>("station");
|
||||
if(stationObject != NULL)
|
||||
{
|
||||
QGeoCoordinate coords = stationObject->property("coordinate").value<QGeoCoordinate>();
|
||||
coords.setLatitude(stationLatitude);
|
||||
coords.setLongitude(stationLongitude);
|
||||
coords.setAltitude(stationAltitude);
|
||||
stationObject->setProperty("coordinate", QVariant::fromValue(coords));
|
||||
stationObject->setProperty("stationName", QVariant::fromValue(MainCore::instance()->getSettings().getStationName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "ADSBDemodGUI::applyMapSettings - Couldn't find station";
|
||||
}
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
newMap = newMap->findChild<QObject*>("map");
|
||||
#endif
|
||||
if (coords.isValid())
|
||||
{
|
||||
newMap->setProperty("zoomLevel", QVariant::fromValue(zoom));
|
||||
|
@ -4812,22 +4831,6 @@ void ADSBDemodGUI::applyMapSettings()
|
|||
{
|
||||
qDebug() << "ADSBDemodGUI::applyMapSettings - createMap returned a nullptr";
|
||||
}
|
||||
|
||||
// Move antenna icon to My Position
|
||||
QObject *stationObject = newMap->findChild<QObject*>("station");
|
||||
if(stationObject != NULL)
|
||||
{
|
||||
QGeoCoordinate coords = stationObject->property("coordinate").value<QGeoCoordinate>();
|
||||
coords.setLatitude(stationLatitude);
|
||||
coords.setLongitude(stationLongitude);
|
||||
coords.setAltitude(stationAltitude);
|
||||
stationObject->setProperty("coordinate", QVariant::fromValue(coords));
|
||||
stationObject->setProperty("stationName", QVariant::fromValue(MainCore::instance()->getSettings().getStationName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "ADSBDemodGUI::applyMapSettings - Couldn't find station";
|
||||
}
|
||||
}
|
||||
|
||||
// Called from QML when empty space clicked
|
||||
|
@ -6000,7 +6003,11 @@ void ADSBDemodGUI::preferenceChanged(int elementType)
|
|||
|
||||
// Update icon position on Map
|
||||
QQuickItem *item = ui->map->rootObject();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QObject *map = item->findChild<QObject*>("map");
|
||||
#else
|
||||
QObject *map = item->findChild<QObject*>("mapView");
|
||||
#endif
|
||||
if (map != nullptr)
|
||||
{
|
||||
QObject *stationObject = map->findChild<QObject*>("station");
|
||||
|
@ -6019,7 +6026,11 @@ void ADSBDemodGUI::preferenceChanged(int elementType)
|
|||
{
|
||||
// Update icon label on Map
|
||||
QQuickItem *item = ui->map->rootObject();
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QObject *map = item->findChild<QObject*>("map");
|
||||
#else
|
||||
QObject *map = item->findChild<QObject*>("mapView");
|
||||
#endif
|
||||
if (map != nullptr)
|
||||
{
|
||||
QObject *stationObject = map->findChild<QObject*>("station");
|
||||
|
|
|
@ -74,6 +74,7 @@ Item {
|
|||
id: station
|
||||
objectName: "station"
|
||||
stationName: "Home"
|
||||
parent: mapView.map
|
||||
}
|
||||
|
||||
MapItemView {
|
||||
|
|
|
@ -198,9 +198,9 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
|
|||
m_polygonMapModel(this),
|
||||
m_polylineMapModel(this),
|
||||
m_beacons(nullptr),
|
||||
m_beaconDialog(this),
|
||||
m_ibpBeaconDialog(this),
|
||||
m_radioTimeDialog(this),
|
||||
m_beaconDialog(this, this),
|
||||
m_ibpBeaconDialog(this, this),
|
||||
m_radioTimeDialog(this, this),
|
||||
m_cesium(nullptr),
|
||||
m_legend(nullptr),
|
||||
m_nasaWidget(nullptr),
|
||||
|
|
|
@ -32,7 +32,6 @@ MapIBPBeaconDialog::MapIBPBeaconDialog(MapGUI *gui, QWidget* parent) :
|
|||
ui->setupUi(this);
|
||||
connect(&m_timer, &QTimer::timeout, this, &MapIBPBeaconDialog::updateTime);
|
||||
m_timer.setInterval(1000);
|
||||
m_timer.start();
|
||||
ui->beacons->setRowCount(IBPBeacon::m_frequencies.size());
|
||||
for (int row = 0; row < IBPBeacon::m_frequencies.size(); row++)
|
||||
{
|
||||
|
@ -44,7 +43,6 @@ MapIBPBeaconDialog::MapIBPBeaconDialog(MapGUI *gui, QWidget* parent) :
|
|||
ui->beacons->setItem(row, IBP_BEACON_COL_DISTANCE, new QTableWidgetItem(""));
|
||||
}
|
||||
resizeTable();
|
||||
updateTable(QTime::currentTime());
|
||||
}
|
||||
|
||||
MapIBPBeaconDialog::~MapIBPBeaconDialog()
|
||||
|
@ -126,3 +124,17 @@ void MapIBPBeaconDialog::updateTime()
|
|||
updateTable(t);
|
||||
}
|
||||
}
|
||||
|
||||
void MapIBPBeaconDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
(void) event;
|
||||
updateTable(QTime::currentTime());
|
||||
updateTime();
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
void MapIBPBeaconDialog::hideEvent(QHideEvent *event)
|
||||
{
|
||||
(void) event;
|
||||
m_timer.stop();
|
||||
}
|
||||
|
|
|
@ -43,6 +43,8 @@ private slots:
|
|||
void accept();
|
||||
void on_beacons_cellDoubleClicked(int row, int column);
|
||||
void updateTime();
|
||||
void showEvent(QShowEvent *event);
|
||||
void hideEvent(QHideEvent *event);
|
||||
|
||||
private:
|
||||
MapGUI *m_gui;
|
||||
|
|
Loading…
Reference in New Issue