mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-30 04:20:21 -04:00 
			
		
		
		
	Map Updates
Fix 3D map for Qt < 5.15. Add 3D map label scale setting. Add 3D map time to Web report. Reduce height of display settings dialog to fit on smaller screens.
This commit is contained in:
		
							parent
							
								
									73848c94e4
								
							
						
					
					
						commit
						29b2941951
					
				| @ -443,7 +443,7 @@ QJsonObject CZML::update(MapItem *mapItem, bool isTarget, bool isSelected) | |||||||
|     QJsonObject label { |     QJsonObject label { | ||||||
|         {"text", mapItem->m_label}, |         {"text", mapItem->m_label}, | ||||||
|         {"show", m_settings->m_displayNames && mapItem->m_itemSettings->m_enabled && mapItem->m_itemSettings->m_display3DLabel}, |         {"show", m_settings->m_displayNames && mapItem->m_itemSettings->m_enabled && mapItem->m_itemSettings->m_display3DLabel}, | ||||||
|         {"scale", 0.5}, |         {"scale", mapItem->m_itemSettings->m_3DLabelScale}, | ||||||
|         {"pixelOffset", labelPixelOffset}, |         {"pixelOffset", labelPixelOffset}, | ||||||
|         {"eyeOffset", labelEyeOffset}, |         {"eyeOffset", labelEyeOffset}, | ||||||
|         {"verticalOrigin",  "BASELINE"}, |         {"verticalOrigin",  "BASELINE"}, | ||||||
|  | |||||||
| @ -43,7 +43,9 @@ const char* const Map::m_featureIdURI = "sdrangel.feature.map"; | |||||||
| const char* const Map::m_featureId = "Map"; | const char* const Map::m_featureId = "Map"; | ||||||
| 
 | 
 | ||||||
| Map::Map(WebAPIAdapterInterface *webAPIAdapterInterface) : | Map::Map(WebAPIAdapterInterface *webAPIAdapterInterface) : | ||||||
|     Feature(m_featureIdURI, webAPIAdapterInterface) |     Feature(m_featureIdURI, webAPIAdapterInterface), | ||||||
|  |     m_multiplier(0.0), | ||||||
|  |     m_dateTimeMutex(QMutex::Recursive) | ||||||
| { | { | ||||||
|     qDebug("Map::Map: webAPIAdapterInterface: %p", webAPIAdapterInterface); |     qDebug("Map::Map: webAPIAdapterInterface: %p", webAPIAdapterInterface); | ||||||
|     setObjectName(m_featureId); |     setObjectName(m_featureId); | ||||||
| @ -206,6 +208,17 @@ int Map::webapiSettingsPutPatch( | |||||||
|     return 200; |     return 200; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | int Map::webapiReportGet( | ||||||
|  |     SWGSDRangel::SWGFeatureReport& response, | ||||||
|  |     QString& errorMessage) | ||||||
|  | { | ||||||
|  |     (void) errorMessage; | ||||||
|  |     response.setMapReport(new SWGSDRangel::SWGMapReport()); | ||||||
|  |     response.getMapReport()->init(); | ||||||
|  |     webapiFormatFeatureReport(response); | ||||||
|  |     return 200; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| int Map::webapiActionsPost( | int Map::webapiActionsPost( | ||||||
|     const QStringList& featureActionsKeys, |     const QStringList& featureActionsKeys, | ||||||
|     SWGSDRangel::SWGFeatureActions& query, |     SWGSDRangel::SWGFeatureActions& query, | ||||||
| @ -356,6 +369,16 @@ void Map::webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const M | |||||||
|     delete swgFeatureSettings; |     delete swgFeatureSettings; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void Map::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) | ||||||
|  | { | ||||||
|  |     QString mapDateTime = getMapDateTime().toString(Qt::ISODateWithMs); | ||||||
|  |     if (response.getMapReport()->getDateTime()) { | ||||||
|  |         *response.getMapReport()->getDateTime() = mapDateTime; | ||||||
|  |     } else { | ||||||
|  |         response.getMapReport()->setDateTime(new QString(mapDateTime)); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void Map::networkManagerFinished(QNetworkReply *reply) | void Map::networkManagerFinished(QNetworkReply *reply) | ||||||
| { | { | ||||||
|     QNetworkReply::NetworkError replyError = reply->error(); |     QNetworkReply::NetworkError replyError = reply->error(); | ||||||
| @ -376,3 +399,29 @@ void Map::networkManagerFinished(QNetworkReply *reply) | |||||||
| 
 | 
 | ||||||
|     reply->deleteLater(); |     reply->deleteLater(); | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | void Map::setMapDateTime(QDateTime mapDateTime, QDateTime systemDateTime, double multiplier) | ||||||
|  | { | ||||||
|  |     QMutexLocker mutexLocker(&m_dateTimeMutex); | ||||||
|  |     m_mapDateTime = mapDateTime; | ||||||
|  |     m_systemDateTime = systemDateTime; | ||||||
|  |     m_multiplier = multiplier; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | QDateTime Map::getMapDateTime() | ||||||
|  | { | ||||||
|  |     QMutexLocker mutexLocker(&m_dateTimeMutex); | ||||||
|  |     if (m_multiplier == 0.0) | ||||||
|  |     { | ||||||
|  |         return m_mapDateTime; | ||||||
|  |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |         // It's not possible to synchronously get the time from Cesium
 | ||||||
|  |         // so we calculate it based on the system clock difference from
 | ||||||
|  |         // when changes were made to the clock GUI elements
 | ||||||
|  |         // Should be accurate enough for satellite tracker
 | ||||||
|  |         qint64 diffMsecs = m_systemDateTime.msecsTo(QDateTime::currentDateTime()); | ||||||
|  |         return m_mapDateTime.addMSecs(diffMsecs * m_multiplier); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | |||||||
| @ -24,6 +24,7 @@ | |||||||
| #include <QNetworkRequest> | #include <QNetworkRequest> | ||||||
| #include <QTimer> | #include <QTimer> | ||||||
| #include <QDateTime> | #include <QDateTime> | ||||||
|  | #include <QMutex> | ||||||
| 
 | 
 | ||||||
| #include "feature/feature.h" | #include "feature/feature.h" | ||||||
| #include "util/message.h" | #include "util/message.h" | ||||||
| @ -127,6 +128,10 @@ public: | |||||||
|             SWGSDRangel::SWGFeatureSettings& response, |             SWGSDRangel::SWGFeatureSettings& response, | ||||||
|             QString& errorMessage); |             QString& errorMessage); | ||||||
| 
 | 
 | ||||||
|  |     virtual int webapiReportGet( | ||||||
|  |             SWGSDRangel::SWGFeatureReport& response, | ||||||
|  |             QString& errorMessage); | ||||||
|  | 
 | ||||||
|     virtual int webapiActionsPost( |     virtual int webapiActionsPost( | ||||||
|             const QStringList& featureActionsKeys, |             const QStringList& featureActionsKeys, | ||||||
|             SWGSDRangel::SWGFeatureActions& query, |             SWGSDRangel::SWGFeatureActions& query, | ||||||
| @ -141,6 +146,9 @@ public: | |||||||
|             const QStringList& featureSettingsKeys, |             const QStringList& featureSettingsKeys, | ||||||
|             SWGSDRangel::SWGFeatureSettings& response); |             SWGSDRangel::SWGFeatureSettings& response); | ||||||
| 
 | 
 | ||||||
|  |     void setMapDateTime(QDateTime mapDateTime, QDateTime systemDateTime, double multiplier); | ||||||
|  |     QDateTime getMapDateTime(); | ||||||
|  | 
 | ||||||
|     static const char* const m_featureIdURI; |     static const char* const m_featureIdURI; | ||||||
|     static const char* const m_featureId; |     static const char* const m_featureId; | ||||||
| 
 | 
 | ||||||
| @ -154,8 +162,14 @@ private: | |||||||
|     QNetworkRequest m_networkRequest; |     QNetworkRequest m_networkRequest; | ||||||
| 
 | 
 | ||||||
|     void applySettings(const MapSettings& settings, bool force = false); |     void applySettings(const MapSettings& settings, bool force = false); | ||||||
|  |     void webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response); | ||||||
|     void webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const MapSettings& settings, bool force); |     void webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const MapSettings& settings, bool force); | ||||||
| 
 | 
 | ||||||
|  |     QDateTime m_mapDateTime; | ||||||
|  |     QDateTime m_systemDateTime; | ||||||
|  |     double m_multiplier; | ||||||
|  |     QMutex m_dateTimeMutex; | ||||||
|  | 
 | ||||||
| private slots: | private slots: | ||||||
|     void updatePipes(); |     void updatePipes(); | ||||||
|     void networkManagerFinished(QNetworkReply *reply); |     void networkManagerFinished(QNetworkReply *reply); | ||||||
|  | |||||||
| @ -216,10 +216,7 @@ | |||||||
|                  viewer.clock.currentTime = dateTime; |                  viewer.clock.currentTime = dateTime; | ||||||
|             } else if (command.command == "getDateTime") { |             } else if (command.command == "getDateTime") { | ||||||
|                  // Get current date and time of viewer |                  // Get current date and time of viewer | ||||||
|                  socket.send(JSON.stringify({ |                  reportClock(); | ||||||
|                      command: "getDateTime", |  | ||||||
|                      dateTime: Cesium.JulianDate.toIso8601(viewer.clock.currentTime) |  | ||||||
|                  })); |  | ||||||
|             } else if (command.command == "setTerrain") { |             } else if (command.command == "setTerrain") { | ||||||
|                 // Support using Ellipsoid terrain for performance and also |                 // Support using Ellipsoid terrain for performance and also | ||||||
|                 // because paths can't be clammped to ground, so AIS paths |                 // because paths can't be clammped to ground, so AIS paths | ||||||
| @ -397,6 +394,39 @@ | |||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|  |     // Report clock changes for use by other plugins | ||||||
|  |     var systemTime = new Cesium.JulianDate(); | ||||||
|  |     function reportClock() { | ||||||
|  |         if (socket.readyState === 1) { | ||||||
|  |             Cesium.JulianDate.now(systemTime); | ||||||
|  |             socket.send(JSON.stringify({ | ||||||
|  |                 event: "clock", | ||||||
|  |                 canAnimate: viewer.clock.canAnimate, | ||||||
|  |                 shouldAnimate: viewer.clock.shouldAnimate, | ||||||
|  |                 currentTime: Cesium.JulianDate.toIso8601(viewer.clock.currentTime), | ||||||
|  |                 multiplier: viewer.clock.multiplier, | ||||||
|  |                 systemTime: Cesium.JulianDate.toIso8601(systemTime) | ||||||
|  |             })); | ||||||
|  |         } | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     Cesium.knockout.getObservable(viewer.clockViewModel, 'shouldAnimate').subscribe(function(isAnimating) { | ||||||
|  |         reportClock(); | ||||||
|  |     }); | ||||||
|  |     Cesium.knockout.getObservable(viewer.clockViewModel, 'multiplier').subscribe(function(multiplier) { | ||||||
|  |         reportClock(); | ||||||
|  |     }); | ||||||
|  |     // This is called every frame | ||||||
|  |     //Cesium.knockout.getObservable(viewer.clockViewModel, 'currentTime').subscribe(function(currentTime) { | ||||||
|  |         //reportClock(); | ||||||
|  |     //}); | ||||||
|  |     viewer.timeline.addEventListener('settime', reportClock, false); | ||||||
|  | 
 | ||||||
|  |     socket.onopen = () => { | ||||||
|  |         reportClock(); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|   </script> |   </script> | ||||||
|  </div> |  </div> | ||||||
| </body> | </body> | ||||||
|  | |||||||
| @ -812,6 +812,7 @@ void MapGUI::applyMap3DSettings(bool reloadMap) | |||||||
|         m_cesium->setSunLight(m_settings.m_sunLightEnabled); |         m_cesium->setSunLight(m_settings.m_sunLightEnabled); | ||||||
|         m_cesium->setCameraReferenceFrame(m_settings.m_eciCamera); |         m_cesium->setCameraReferenceFrame(m_settings.m_eciCamera); | ||||||
|         m_cesium->setAntiAliasing(m_settings.m_antiAliasing); |         m_cesium->setAntiAliasing(m_settings.m_antiAliasing); | ||||||
|  |         m_cesium->getDateTime(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -826,14 +827,14 @@ void MapGUI::init3DMap() | |||||||
|     m_cesium->setSunLight(m_settings.m_sunLightEnabled); |     m_cesium->setSunLight(m_settings.m_sunLightEnabled); | ||||||
|     m_cesium->setCameraReferenceFrame(m_settings.m_eciCamera); |     m_cesium->setCameraReferenceFrame(m_settings.m_eciCamera); | ||||||
|     m_cesium->setAntiAliasing(m_settings.m_antiAliasing); |     m_cesium->setAntiAliasing(m_settings.m_antiAliasing); | ||||||
|  |     m_cesium->getDateTime(); | ||||||
| 
 | 
 | ||||||
|  |     m_mapModel.allUpdated(); | ||||||
|     float stationLatitude = MainCore::instance()->getSettings().getLatitude(); |     float stationLatitude = MainCore::instance()->getSettings().getLatitude(); | ||||||
|     float stationLongitude = MainCore::instance()->getSettings().getLongitude(); |     float stationLongitude = MainCore::instance()->getSettings().getLongitude(); | ||||||
| 
 | 
 | ||||||
|     // Set 3D view after loading initial objects
 |     // Set 3D view after loading initial objects
 | ||||||
|     m_cesium->setHomeView(stationLatitude, stationLongitude); |     m_cesium->setHomeView(stationLatitude, stationLongitude); | ||||||
| 
 |  | ||||||
|     m_mapModel.allUpdated(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MapGUI::displaySettings() | void MapGUI::displaySettings() | ||||||
| @ -1144,6 +1145,18 @@ void MapGUI::receivedCesiumEvent(const QJsonObject &obj) | |||||||
|                 //m_mapModel.setTarget("");
 |                 //m_mapModel.setTarget("");
 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |         else if (event == "clock") | ||||||
|  |         { | ||||||
|  |             if (m_map) | ||||||
|  |             { | ||||||
|  |                 QDateTime mapDateTime = QDateTime::fromString(obj.value("currentTime").toString(), Qt::ISODateWithMs); | ||||||
|  |                 QDateTime systemDateTime = QDateTime::fromString(obj.value("systemTime").toString(), Qt::ISODateWithMs); | ||||||
|  |                 double multiplier = obj.value("multiplier").toDouble(); | ||||||
|  |                 bool canAnimate = obj.value("canAnimate").toBool(); | ||||||
|  |                 bool shouldAnimate = obj.value("shouldAnimate").toBool(); | ||||||
|  |                 m_map->setMapDateTime(mapDateTime, systemDateTime, canAnimate && shouldAnimate ? multiplier : 0.0); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -251,6 +251,7 @@ void MapSettings::MapItemSettings::resetToDefaults() | |||||||
|     m_display3DTrack = true; |     m_display3DTrack = true; | ||||||
|     m_3DTrackColor = QColor(150, 0, 20).rgb(); |     m_3DTrackColor = QColor(150, 0, 20).rgb(); | ||||||
|     m_3DModelMinPixelSize = 0; |     m_3DModelMinPixelSize = 0; | ||||||
|  |     m_3DLabelScale = 0.5f; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| QByteArray MapSettings::MapItemSettings::serialize() const | QByteArray MapSettings::MapItemSettings::serialize() const | ||||||
| @ -271,6 +272,7 @@ QByteArray MapSettings::MapItemSettings::serialize() const | |||||||
|     s.writeBool(12, m_display3DTrack); |     s.writeBool(12, m_display3DTrack); | ||||||
|     s.writeU32(13, m_3DTrackColor); |     s.writeU32(13, m_3DTrackColor); | ||||||
|     s.writeS32(14, m_3DModelMinPixelSize); |     s.writeS32(14, m_3DModelMinPixelSize); | ||||||
|  |     s.writeFloat(15, m_3DLabelScale); | ||||||
| 
 | 
 | ||||||
|     return s.final(); |     return s.final(); | ||||||
| } | } | ||||||
| @ -301,6 +303,7 @@ bool MapSettings::MapItemSettings::deserialize(const QByteArray& data) | |||||||
|         d.readBool(12, &m_display3DTrack, true); |         d.readBool(12, &m_display3DTrack, true); | ||||||
|         d.readU32(13, &m_3DTrackColor, QColor(150, 0, 20).rgb()); |         d.readU32(13, &m_3DTrackColor, QColor(150, 0, 20).rgb()); | ||||||
|         d.readS32(14, &m_3DModelMinPixelSize, 0); |         d.readS32(14, &m_3DModelMinPixelSize, 0); | ||||||
|  |         d.readFloat(15, &m_3DLabelScale, 0.5f); | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|  | |||||||
| @ -42,6 +42,7 @@ struct MapSettings | |||||||
|         bool m_display3DTrack;    // Display a ground track for this item on the 3D map
 |         bool m_display3DTrack;    // Display a ground track for this item on the 3D map
 | ||||||
|         quint32 m_3DTrackColor; |         quint32 m_3DTrackColor; | ||||||
|         int m_3DModelMinPixelSize; |         int m_3DModelMinPixelSize; | ||||||
|  |         float m_3DLabelScale; | ||||||
| 
 | 
 | ||||||
|         MapItemSettings(const QString& group, const QColor color, bool display3DPoint=true, int minZoom=11, int modelMinPixelSize=0); |         MapItemSettings(const QString& group, const QColor color, bool display3DPoint=true, int minZoom=11, int modelMinPixelSize=0); | ||||||
|         MapItemSettings(const QByteArray& data); |         MapItemSettings(const QByteArray& data); | ||||||
|  | |||||||
| @ -96,8 +96,13 @@ MapItemSettingsGUI::MapItemSettingsGUI(QTableWidget *table, int row, MapSettings | |||||||
|     m_minPixels = new QSpinBox(table); |     m_minPixels = new QSpinBox(table); | ||||||
|     m_minPixels->setRange(0, 200); |     m_minPixels->setRange(0, 200); | ||||||
|     m_minPixels->setValue(settings->m_3DModelMinPixelSize); |     m_minPixels->setValue(settings->m_3DModelMinPixelSize); | ||||||
|  |     m_labelScale = new QDoubleSpinBox(table); | ||||||
|  |     m_labelScale->setDecimals(2); | ||||||
|  |     m_labelScale->setRange(0.01, 10.0); | ||||||
|  |     m_labelScale->setValue(settings->m_3DLabelScale); | ||||||
|     table->setCellWidget(row, MapSettingsDialog::COL_2D_MIN_ZOOM, m_minZoom); |     table->setCellWidget(row, MapSettingsDialog::COL_2D_MIN_ZOOM, m_minZoom); | ||||||
|     table->setCellWidget(row, MapSettingsDialog::COL_3D_MIN_PIXELS, m_minPixels); |     table->setCellWidget(row, MapSettingsDialog::COL_3D_MIN_PIXELS, m_minPixels); | ||||||
|  |     table->setCellWidget(row, MapSettingsDialog::COL_3D_LABEL_SCALE, m_labelScale); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) : | MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) : | ||||||
| @ -241,6 +246,7 @@ void MapSettingsDialog::accept() | |||||||
|         itemSettings->m_display3DTrack = !gui->m_track3D.m_noColor; |         itemSettings->m_display3DTrack = !gui->m_track3D.m_noColor; | ||||||
|         itemSettings->m_3DTrackColor = gui->m_track3D.m_color; |         itemSettings->m_3DTrackColor = gui->m_track3D.m_color; | ||||||
|         itemSettings->m_3DModelMinPixelSize = gui->m_minPixels->value(); |         itemSettings->m_3DModelMinPixelSize = gui->m_minPixels->value(); | ||||||
|  |         itemSettings->m_3DLabelScale = gui->m_labelScale->value(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     QDialog::accept(); |     QDialog::accept(); | ||||||
| @ -276,6 +282,7 @@ void MapSettingsDialog::on_map3DEnabled_clicked(bool checked) | |||||||
|         ui->mapItemSettings->showColumn(COL_3D_LABEL); |         ui->mapItemSettings->showColumn(COL_3D_LABEL); | ||||||
|         ui->mapItemSettings->showColumn(COL_3D_POINT); |         ui->mapItemSettings->showColumn(COL_3D_POINT); | ||||||
|         ui->mapItemSettings->showColumn(COL_3D_TRACK); |         ui->mapItemSettings->showColumn(COL_3D_TRACK); | ||||||
|  |         ui->mapItemSettings->showColumn(COL_3D_LABEL_SCALE); | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|     { |     { | ||||||
| @ -284,6 +291,7 @@ void MapSettingsDialog::on_map3DEnabled_clicked(bool checked) | |||||||
|         ui->mapItemSettings->hideColumn(COL_3D_LABEL); |         ui->mapItemSettings->hideColumn(COL_3D_LABEL); | ||||||
|         ui->mapItemSettings->hideColumn(COL_3D_POINT); |         ui->mapItemSettings->hideColumn(COL_3D_POINT); | ||||||
|         ui->mapItemSettings->hideColumn(COL_3D_TRACK); |         ui->mapItemSettings->hideColumn(COL_3D_TRACK); | ||||||
|  |         ui->mapItemSettings->hideColumn(COL_3D_LABEL_SCALE); | ||||||
|     } |     } | ||||||
|     ui->terrain->setEnabled(checked); |     ui->terrain->setEnabled(checked); | ||||||
|     ui->buildings->setEnabled(checked); |     ui->buildings->setEnabled(checked); | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ | |||||||
| #define INCLUDE_FEATURE_MAPSETTINGSDIALOG_H | #define INCLUDE_FEATURE_MAPSETTINGSDIALOG_H | ||||||
| 
 | 
 | ||||||
| #include <QSpinBox> | #include <QSpinBox> | ||||||
|  | #include <QDoubleSpinBox> | ||||||
| #include <QMessageBox> | #include <QMessageBox> | ||||||
| 
 | 
 | ||||||
| #include "gui/httpdownloadmanagergui.h" | #include "gui/httpdownloadmanagergui.h" | ||||||
| @ -56,6 +57,7 @@ public: | |||||||
|     MapColorGUI m_track3D; |     MapColorGUI m_track3D; | ||||||
|     QSpinBox *m_minZoom; |     QSpinBox *m_minZoom; | ||||||
|     QSpinBox *m_minPixels; |     QSpinBox *m_minPixels; | ||||||
|  |     QDoubleSpinBox *m_labelScale; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class MapSettingsDialog : public QDialog { | class MapSettingsDialog : public QDialog { | ||||||
| @ -75,7 +77,8 @@ public: | |||||||
|         COL_3D_MIN_PIXELS, |         COL_3D_MIN_PIXELS, | ||||||
|         COL_3D_LABEL, |         COL_3D_LABEL, | ||||||
|         COL_3D_POINT, |         COL_3D_POINT, | ||||||
|         COL_3D_TRACK |         COL_3D_TRACK, | ||||||
|  |         COL_3D_LABEL_SCALE | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|  | |||||||
| @ -6,8 +6,8 @@ | |||||||
|    <rect> |    <rect> | ||||||
|     <x>0</x> |     <x>0</x> | ||||||
|     <y>0</y> |     <y>0</y> | ||||||
|     <width>946</width> |     <width>1016</width> | ||||||
|     <height>800</height> |     <height>720</height> | ||||||
|    </rect> |    </rect> | ||||||
|   </property> |   </property> | ||||||
|   <property name="font"> |   <property name="font"> | ||||||
| @ -26,12 +26,15 @@ | |||||||
|        <number>0</number> |        <number>0</number> | ||||||
|       </property> |       </property> | ||||||
|       <item> |       <item> | ||||||
|        <widget class="QLabel" name="locationsLabel"> |        <widget class="QTabWidget" name="tabWidget"> | ||||||
|         <property name="text"> |         <property name="currentIndex"> | ||||||
|          <string>Select how to display items on the maps:</string> |          <number>0</number> | ||||||
|         </property> |         </property> | ||||||
|        </widget> |         <widget class="QWidget" name="mapsTab"> | ||||||
|       </item> |          <attribute name="title"> | ||||||
|  |           <string>Maps</string> | ||||||
|  |          </attribute> | ||||||
|  |          <layout class="QVBoxLayout" name="verticalLayout_3"> | ||||||
|           <item> |           <item> | ||||||
|            <widget class="QTableWidget" name="mapItemSettings"> |            <widget class="QTableWidget" name="mapItemSettings"> | ||||||
|             <property name="selectionMode"> |             <property name="selectionMode"> | ||||||
| @ -87,6 +90,11 @@ | |||||||
|               <string>3D Track</string> |               <string>3D Track</string> | ||||||
|              </property> |              </property> | ||||||
|             </column> |             </column> | ||||||
|  |             <column> | ||||||
|  |              <property name="text"> | ||||||
|  |               <string>3D Label Scale</string> | ||||||
|  |              </property> | ||||||
|  |             </column> | ||||||
|            </widget> |            </widget> | ||||||
|           </item> |           </item> | ||||||
|           <item> |           <item> | ||||||
| @ -338,6 +346,40 @@ | |||||||
|             </layout> |             </layout> | ||||||
|            </widget> |            </widget> | ||||||
|           </item> |           </item> | ||||||
|  |           <item> | ||||||
|  |            <layout class="QHBoxLayout" name="horizontalLayout"> | ||||||
|  |             <item> | ||||||
|  |              <widget class="QPushButton" name="downloadModels"> | ||||||
|  |               <property name="toolTip"> | ||||||
|  |                <string>Download 3D models. It is recommended to restart SDRangel after download.</string> | ||||||
|  |               </property> | ||||||
|  |               <property name="text"> | ||||||
|  |                <string>Download 3D Models (1.6GB)</string> | ||||||
|  |               </property> | ||||||
|  |              </widget> | ||||||
|  |             </item> | ||||||
|  |             <item> | ||||||
|  |              <spacer name="horizontalSpacer"> | ||||||
|  |               <property name="orientation"> | ||||||
|  |                <enum>Qt::Horizontal</enum> | ||||||
|  |               </property> | ||||||
|  |               <property name="sizeHint" stdset="0"> | ||||||
|  |                <size> | ||||||
|  |                 <width>40</width> | ||||||
|  |                 <height>20</height> | ||||||
|  |                </size> | ||||||
|  |               </property> | ||||||
|  |              </spacer> | ||||||
|  |             </item> | ||||||
|  |            </layout> | ||||||
|  |           </item> | ||||||
|  |          </layout> | ||||||
|  |         </widget> | ||||||
|  |         <widget class="QWidget" name="apiKeysTab"> | ||||||
|  |          <attribute name="title"> | ||||||
|  |           <string>API Keys</string> | ||||||
|  |          </attribute> | ||||||
|  |          <layout class="QVBoxLayout" name="verticalLayout_4"> | ||||||
|           <item> |           <item> | ||||||
|            <widget class="QGroupBox" name="apiKeys"> |            <widget class="QGroupBox" name="apiKeys"> | ||||||
|             <property name="title"> |             <property name="title"> | ||||||
| @ -427,32 +469,9 @@ | |||||||
|             </layout> |             </layout> | ||||||
|            </widget> |            </widget> | ||||||
|           </item> |           </item> | ||||||
|       <item> |  | ||||||
|        <layout class="QHBoxLayout" name="horizontalLayout"> |  | ||||||
|         <item> |  | ||||||
|          <widget class="QPushButton" name="downloadModels"> |  | ||||||
|           <property name="toolTip"> |  | ||||||
|            <string>Download 3D models. It is recommended to restart SDRangel after download.</string> |  | ||||||
|           </property> |  | ||||||
|           <property name="text"> |  | ||||||
|            <string>Download 3D Models (1.6GB)</string> |  | ||||||
|           </property> |  | ||||||
|          </widget> |  | ||||||
|         </item> |  | ||||||
|         <item> |  | ||||||
|          <spacer name="horizontalSpacer"> |  | ||||||
|           <property name="orientation"> |  | ||||||
|            <enum>Qt::Horizontal</enum> |  | ||||||
|           </property> |  | ||||||
|           <property name="sizeHint" stdset="0"> |  | ||||||
|            <size> |  | ||||||
|             <width>40</width> |  | ||||||
|             <height>20</height> |  | ||||||
|            </size> |  | ||||||
|           </property> |  | ||||||
|          </spacer> |  | ||||||
|         </item> |  | ||||||
|          </layout> |          </layout> | ||||||
|  |         </widget> | ||||||
|  |        </widget> | ||||||
|       </item> |       </item> | ||||||
|      </layout> |      </layout> | ||||||
|     </widget> |     </widget> | ||||||
| @ -470,6 +489,7 @@ | |||||||
|   </layout> |   </layout> | ||||||
|  </widget> |  </widget> | ||||||
|  <tabstops> |  <tabstops> | ||||||
|  |   <tabstop>tabWidget</tabstop> | ||||||
|   <tabstop>mapItemSettings</tabstop> |   <tabstop>mapItemSettings</tabstop> | ||||||
|   <tabstop>map2DEnabled</tabstop> |   <tabstop>map2DEnabled</tabstop> | ||||||
|   <tabstop>mapProvider</tabstop> |   <tabstop>mapProvider</tabstop> | ||||||
| @ -481,11 +501,11 @@ | |||||||
|   <tabstop>sunLightEnabled</tabstop> |   <tabstop>sunLightEnabled</tabstop> | ||||||
|   <tabstop>eciCamera</tabstop> |   <tabstop>eciCamera</tabstop> | ||||||
|   <tabstop>antiAliasing</tabstop> |   <tabstop>antiAliasing</tabstop> | ||||||
|  |   <tabstop>downloadModels</tabstop> | ||||||
|   <tabstop>thunderforestAPIKey</tabstop> |   <tabstop>thunderforestAPIKey</tabstop> | ||||||
|   <tabstop>maptilerAPIKey</tabstop> |   <tabstop>maptilerAPIKey</tabstop> | ||||||
|   <tabstop>mapBoxAPIKey</tabstop> |   <tabstop>mapBoxAPIKey</tabstop> | ||||||
|   <tabstop>cesiumIonAPIKey</tabstop> |   <tabstop>cesiumIonAPIKey</tabstop> | ||||||
|   <tabstop>downloadModels</tabstop> |  | ||||||
|  </tabstops> |  </tabstops> | ||||||
|  <resources/> |  <resources/> | ||||||
|  <connections> |  <connections> | ||||||
|  | |||||||
| @ -157,6 +157,9 @@ void WebServer::readClient() | |||||||
|             if (res.isValid() && (res.size() > 0)) |             if (res.isValid() && (res.size() > 0)) | ||||||
|             { |             { | ||||||
|                 QByteArray data = QByteArray::fromRawData((const char *)res.data(), res.size()); |                 QByteArray data = QByteArray::fromRawData((const char *)res.data(), res.size()); | ||||||
|  |                 if (res.isCompressed()) { | ||||||
|  |                     data = qUncompress(data); | ||||||
|  |                 } | ||||||
|                 sendFile(socket, data, mimeType, path); |                 sendFile(socket, data, mimeType, path); | ||||||
|             } |             } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -40,6 +40,9 @@ FITS::FITS(QString resourceName) : | |||||||
|     m_fileSize = m_res.uncompressedSize(); |     m_fileSize = m_res.uncompressedSize(); | ||||||
| #else | #else | ||||||
|     m_data = QByteArray::fromRawData((const char *)m_res.data(), m_res.size()); |     m_data = QByteArray::fromRawData((const char *)m_res.data(), m_res.size()); | ||||||
|  |     if (res.isCompressed()) { | ||||||
|  |         m_data = qUncompress(m_data); | ||||||
|  |     } | ||||||
|     m_fileSize = m_res.size(); |     m_fileSize = m_res.size(); | ||||||
| #endif | #endif | ||||||
|     int hLen = std::min((qint64)m_headerSize * 3, m_fileSize);   // Could possibly be bigger
 |     int hLen = std::min((qint64)m_headerSize * 3, m_fileSize);   // Could possibly be bigger
 | ||||||
|  | |||||||
| @ -5145,14 +5145,29 @@ void WebAPIRequestMapper::resetFeatureReport(SWGSDRangel::SWGFeatureReport& feat | |||||||
| { | { | ||||||
|     featureReport.cleanup(); |     featureReport.cleanup(); | ||||||
|     featureReport.setFeatureType(nullptr); |     featureReport.setFeatureType(nullptr); | ||||||
|  |     featureReport.setAfcReport(nullptr); | ||||||
|  |     featureReport.setGs232ControllerReport(nullptr); | ||||||
|  |     featureReport.setPerTesterReport(nullptr); | ||||||
|  |     featureReport.setRigCtlServerReport(nullptr); | ||||||
|  |     featureReport.setMapReport(nullptr); | ||||||
|  |     featureReport.setSatelliteTrackerReport(nullptr); | ||||||
|     featureReport.setSimplePttReport(nullptr); |     featureReport.setSimplePttReport(nullptr); | ||||||
|  |     featureReport.setStarTrackerReport(nullptr); | ||||||
|  |     featureReport.setVorLocalizerReport(nullptr); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void WebAPIRequestMapper::resetFeatureActions(SWGSDRangel::SWGFeatureActions& featureActions) | void WebAPIRequestMapper::resetFeatureActions(SWGSDRangel::SWGFeatureActions& featureActions) | ||||||
| { | { | ||||||
|     featureActions.cleanup(); |     featureActions.cleanup(); | ||||||
|     featureActions.setFeatureType(nullptr); |     featureActions.setFeatureType(nullptr); | ||||||
|  |     featureActions.setAfcActions(nullptr); | ||||||
|  |     featureActions.setGs232ControllerActions(nullptr); | ||||||
|     featureActions.setMapActions(nullptr); |     featureActions.setMapActions(nullptr); | ||||||
|  |     featureActions.setPerTesterActions(nullptr); | ||||||
|  |     featureActions.setRigCtlServerActions(nullptr); | ||||||
|  |     featureActions.setSatelliteTrackerActions(nullptr); | ||||||
|     featureActions.setSimplePttActions(nullptr); |     featureActions.setSimplePttActions(nullptr); | ||||||
|  |     featureActions.setStarTrackerActions(nullptr); | ||||||
|  |     featureActions.setVorLocalizerActions(nullptr); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -11,6 +11,8 @@ FeatureReport: | |||||||
|       $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCReport" |       $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCReport" | ||||||
|     GS232ControllerReport: |     GS232ControllerReport: | ||||||
|       $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerReport" |       $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerReport" | ||||||
|  |     MapReport: | ||||||
|  |       $ref: "http://swgserver:8081/api/swagger/include/Map.yaml#/MapReport" | ||||||
|     PERTesterReport: |     PERTesterReport: | ||||||
|       $ref: "http://swgserver:8081/api/swagger/include/PERTester.yaml#/PERTesterReport" |       $ref: "http://swgserver:8081/api/swagger/include/PERTester.yaml#/PERTesterReport" | ||||||
|     RigCtlServerReport: |     RigCtlServerReport: | ||||||
|  | |||||||
| @ -22,6 +22,13 @@ MapSettings: | |||||||
|     rollupState: |     rollupState: | ||||||
|       $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" |       $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" | ||||||
| 
 | 
 | ||||||
|  | MapReport: | ||||||
|  |   description: Map | ||||||
|  |   properties: | ||||||
|  |     dateTime: | ||||||
|  |       description: "Current date and time being displayed by 3D map" | ||||||
|  |       type: string | ||||||
|  | 
 | ||||||
| MapActions: | MapActions: | ||||||
|   description: Map |   description: Map | ||||||
|   properties: |   properties: | ||||||
|  | |||||||
| @ -34,6 +34,8 @@ SWGFeatureReport::SWGFeatureReport() { | |||||||
|     m_afc_report_isSet = false; |     m_afc_report_isSet = false; | ||||||
|     gs232_controller_report = nullptr; |     gs232_controller_report = nullptr; | ||||||
|     m_gs232_controller_report_isSet = false; |     m_gs232_controller_report_isSet = false; | ||||||
|  |     map_report = nullptr; | ||||||
|  |     m_map_report_isSet = false; | ||||||
|     per_tester_report = nullptr; |     per_tester_report = nullptr; | ||||||
|     m_per_tester_report_isSet = false; |     m_per_tester_report_isSet = false; | ||||||
|     rig_ctl_server_report = nullptr; |     rig_ctl_server_report = nullptr; | ||||||
| @ -60,6 +62,8 @@ SWGFeatureReport::init() { | |||||||
|     m_afc_report_isSet = false; |     m_afc_report_isSet = false; | ||||||
|     gs232_controller_report = new SWGGS232ControllerReport(); |     gs232_controller_report = new SWGGS232ControllerReport(); | ||||||
|     m_gs232_controller_report_isSet = false; |     m_gs232_controller_report_isSet = false; | ||||||
|  |     map_report = new SWGMapReport(); | ||||||
|  |     m_map_report_isSet = false; | ||||||
|     per_tester_report = new SWGPERTesterReport(); |     per_tester_report = new SWGPERTesterReport(); | ||||||
|     m_per_tester_report_isSet = false; |     m_per_tester_report_isSet = false; | ||||||
|     rig_ctl_server_report = new SWGRigCtlServerReport(); |     rig_ctl_server_report = new SWGRigCtlServerReport(); | ||||||
| @ -85,6 +89,9 @@ SWGFeatureReport::cleanup() { | |||||||
|     if(gs232_controller_report != nullptr) {  |     if(gs232_controller_report != nullptr) {  | ||||||
|         delete gs232_controller_report; |         delete gs232_controller_report; | ||||||
|     } |     } | ||||||
|  |     if(map_report != nullptr) {  | ||||||
|  |         delete map_report; | ||||||
|  |     } | ||||||
|     if(per_tester_report != nullptr) {  |     if(per_tester_report != nullptr) {  | ||||||
|         delete per_tester_report; |         delete per_tester_report; | ||||||
|     } |     } | ||||||
| @ -122,6 +129,8 @@ SWGFeatureReport::fromJsonObject(QJsonObject &pJson) { | |||||||
|      |      | ||||||
|     ::SWGSDRangel::setValue(&gs232_controller_report, pJson["GS232ControllerReport"], "SWGGS232ControllerReport", "SWGGS232ControllerReport"); |     ::SWGSDRangel::setValue(&gs232_controller_report, pJson["GS232ControllerReport"], "SWGGS232ControllerReport", "SWGGS232ControllerReport"); | ||||||
|      |      | ||||||
|  |     ::SWGSDRangel::setValue(&map_report, pJson["MapReport"], "SWGMapReport", "SWGMapReport"); | ||||||
|  |      | ||||||
|     ::SWGSDRangel::setValue(&per_tester_report, pJson["PERTesterReport"], "SWGPERTesterReport", "SWGPERTesterReport"); |     ::SWGSDRangel::setValue(&per_tester_report, pJson["PERTesterReport"], "SWGPERTesterReport", "SWGPERTesterReport"); | ||||||
|      |      | ||||||
|     ::SWGSDRangel::setValue(&rig_ctl_server_report, pJson["RigCtlServerReport"], "SWGRigCtlServerReport", "SWGRigCtlServerReport"); |     ::SWGSDRangel::setValue(&rig_ctl_server_report, pJson["RigCtlServerReport"], "SWGRigCtlServerReport", "SWGRigCtlServerReport"); | ||||||
| @ -159,6 +168,9 @@ SWGFeatureReport::asJsonObject() { | |||||||
|     if((gs232_controller_report != nullptr) && (gs232_controller_report->isSet())){ |     if((gs232_controller_report != nullptr) && (gs232_controller_report->isSet())){ | ||||||
|         toJsonValue(QString("GS232ControllerReport"), gs232_controller_report, obj, QString("SWGGS232ControllerReport")); |         toJsonValue(QString("GS232ControllerReport"), gs232_controller_report, obj, QString("SWGGS232ControllerReport")); | ||||||
|     } |     } | ||||||
|  |     if((map_report != nullptr) && (map_report->isSet())){ | ||||||
|  |         toJsonValue(QString("MapReport"), map_report, obj, QString("SWGMapReport")); | ||||||
|  |     } | ||||||
|     if((per_tester_report != nullptr) && (per_tester_report->isSet())){ |     if((per_tester_report != nullptr) && (per_tester_report->isSet())){ | ||||||
|         toJsonValue(QString("PERTesterReport"), per_tester_report, obj, QString("SWGPERTesterReport")); |         toJsonValue(QString("PERTesterReport"), per_tester_report, obj, QString("SWGPERTesterReport")); | ||||||
|     } |     } | ||||||
| @ -211,6 +223,16 @@ SWGFeatureReport::setGs232ControllerReport(SWGGS232ControllerReport* gs232_contr | |||||||
|     this->m_gs232_controller_report_isSet = true; |     this->m_gs232_controller_report_isSet = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | SWGMapReport* | ||||||
|  | SWGFeatureReport::getMapReport() { | ||||||
|  |     return map_report; | ||||||
|  | } | ||||||
|  | void | ||||||
|  | SWGFeatureReport::setMapReport(SWGMapReport* map_report) { | ||||||
|  |     this->map_report = map_report; | ||||||
|  |     this->m_map_report_isSet = true; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| SWGPERTesterReport* | SWGPERTesterReport* | ||||||
| SWGFeatureReport::getPerTesterReport() { | SWGFeatureReport::getPerTesterReport() { | ||||||
|     return per_tester_report; |     return per_tester_report; | ||||||
| @ -285,6 +307,9 @@ SWGFeatureReport::isSet(){ | |||||||
|         if(gs232_controller_report && gs232_controller_report->isSet()){ |         if(gs232_controller_report && gs232_controller_report->isSet()){ | ||||||
|             isObjectUpdated = true; break; |             isObjectUpdated = true; break; | ||||||
|         } |         } | ||||||
|  |         if(map_report && map_report->isSet()){ | ||||||
|  |             isObjectUpdated = true; break; | ||||||
|  |         } | ||||||
|         if(per_tester_report && per_tester_report->isSet()){ |         if(per_tester_report && per_tester_report->isSet()){ | ||||||
|             isObjectUpdated = true; break; |             isObjectUpdated = true; break; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -24,6 +24,7 @@ | |||||||
| 
 | 
 | ||||||
| #include "SWGAFCReport.h" | #include "SWGAFCReport.h" | ||||||
| #include "SWGGS232ControllerReport.h" | #include "SWGGS232ControllerReport.h" | ||||||
|  | #include "SWGMapReport.h" | ||||||
| #include "SWGPERTesterReport.h" | #include "SWGPERTesterReport.h" | ||||||
| #include "SWGRigCtlServerReport.h" | #include "SWGRigCtlServerReport.h" | ||||||
| #include "SWGSatelliteTrackerReport.h" | #include "SWGSatelliteTrackerReport.h" | ||||||
| @ -59,6 +60,9 @@ public: | |||||||
|     SWGGS232ControllerReport* getGs232ControllerReport(); |     SWGGS232ControllerReport* getGs232ControllerReport(); | ||||||
|     void setGs232ControllerReport(SWGGS232ControllerReport* gs232_controller_report); |     void setGs232ControllerReport(SWGGS232ControllerReport* gs232_controller_report); | ||||||
| 
 | 
 | ||||||
|  |     SWGMapReport* getMapReport(); | ||||||
|  |     void setMapReport(SWGMapReport* map_report); | ||||||
|  | 
 | ||||||
|     SWGPERTesterReport* getPerTesterReport(); |     SWGPERTesterReport* getPerTesterReport(); | ||||||
|     void setPerTesterReport(SWGPERTesterReport* per_tester_report); |     void setPerTesterReport(SWGPERTesterReport* per_tester_report); | ||||||
| 
 | 
 | ||||||
| @ -90,6 +94,9 @@ private: | |||||||
|     SWGGS232ControllerReport* gs232_controller_report; |     SWGGS232ControllerReport* gs232_controller_report; | ||||||
|     bool m_gs232_controller_report_isSet; |     bool m_gs232_controller_report_isSet; | ||||||
| 
 | 
 | ||||||
|  |     SWGMapReport* map_report; | ||||||
|  |     bool m_map_report_isSet; | ||||||
|  | 
 | ||||||
|     SWGPERTesterReport* per_tester_report; |     SWGPERTesterReport* per_tester_report; | ||||||
|     bool m_per_tester_report_isSet; |     bool m_per_tester_report_isSet; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -175,6 +175,7 @@ | |||||||
| #include "SWGMapCoordinate.h" | #include "SWGMapCoordinate.h" | ||||||
| #include "SWGMapItem.h" | #include "SWGMapItem.h" | ||||||
| #include "SWGMapItem_2.h" | #include "SWGMapItem_2.h" | ||||||
|  | #include "SWGMapReport.h" | ||||||
| #include "SWGMapSettings.h" | #include "SWGMapSettings.h" | ||||||
| #include "SWGMetisMISOSettings.h" | #include "SWGMetisMISOSettings.h" | ||||||
| #include "SWGNFMDemodReport.h" | #include "SWGNFMDemodReport.h" | ||||||
| @ -1124,6 +1125,11 @@ namespace SWGSDRangel { | |||||||
|       obj->init(); |       obj->init(); | ||||||
|       return obj; |       return obj; | ||||||
|     } |     } | ||||||
|  |     if(QString("SWGMapReport").compare(type) == 0) { | ||||||
|  |       SWGMapReport *obj = new SWGMapReport(); | ||||||
|  |       obj->init(); | ||||||
|  |       return obj; | ||||||
|  |     } | ||||||
|     if(QString("SWGMapSettings").compare(type) == 0) { |     if(QString("SWGMapSettings").compare(type) == 0) { | ||||||
|       SWGMapSettings *obj = new SWGMapSettings(); |       SWGMapSettings *obj = new SWGMapSettings(); | ||||||
|       obj->init(); |       obj->init(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user