mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
Fix Satellite Tracker build and warnings on Linux
This commit is contained in:
parent
ef4544b640
commit
b9ccaae744
@ -5,9 +5,9 @@ IF(NOT APT_FOUND)
|
|||||||
FIND_PATH(
|
FIND_PATH(
|
||||||
APT_INCLUDE_DIR
|
APT_INCLUDE_DIR
|
||||||
NAMES apt.h
|
NAMES apt.h
|
||||||
HINTS ${APT_DIR}/include
|
HINTS ${APT_DIR}/include/apt
|
||||||
PATHS /usr/local/include
|
PATHS /usr/local/include/apt
|
||||||
/usr/include
|
/usr/include/apt
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(
|
FIND_LIBRARY(
|
||||||
|
@ -4,10 +4,10 @@ IF(NOT SGP4_FOUND)
|
|||||||
|
|
||||||
FIND_PATH(
|
FIND_PATH(
|
||||||
SGP4_INCLUDE_DIR
|
SGP4_INCLUDE_DIR
|
||||||
NAMES SGP4/SGP4.h
|
NAMES SGP4.h
|
||||||
HINTS ${SGP4_DIR}/include
|
HINTS ${SGP4_DIR}/include/SGP4
|
||||||
PATHS /usr/local/include
|
PATHS /usr/local/include/SGP4
|
||||||
/usr/include
|
/usr/include/SGP4
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(
|
FIND_LIBRARY(
|
||||||
|
@ -53,7 +53,7 @@ if(NOT SERVER_MODE)
|
|||||||
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
|
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
|
||||||
else()
|
else()
|
||||||
set(TARGET_NAME featuresatellitetrackersrv)
|
set(TARGET_NAME featuresatellitetrackersrv)
|
||||||
set(TARGET_LIB "")
|
set(TARGET_LIB Qt5::Positioning)
|
||||||
set(TARGET_LIB_GUI "")
|
set(TARGET_LIB_GUI "")
|
||||||
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
|
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
@ -255,6 +255,7 @@ void SatelliteDeviceSettingsGUI::on_m_deviceSetWidget_currentTextChanged(const Q
|
|||||||
// Update doppler combo, to correspond to selected preset
|
// Update doppler combo, to correspond to selected preset
|
||||||
void SatelliteDeviceSettingsGUI::on_m_presetWidget_currentIndexChanged(int index)
|
void SatelliteDeviceSettingsGUI::on_m_presetWidget_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
|
(void) index;
|
||||||
addChannels();
|
addChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,8 @@ void SatelliteRadioControlDialog::on_remove_clicked()
|
|||||||
|
|
||||||
void SatelliteRadioControlDialog::on_satelliteSelect_currentIndexChanged(int index)
|
void SatelliteRadioControlDialog::on_satelliteSelect_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
|
(void) index;
|
||||||
|
|
||||||
// Save details from current GUI elements
|
// Save details from current GUI elements
|
||||||
for (int i = 0; i < m_devSettingsGUIs.size(); i++)
|
for (int i = 0; i < m_devSettingsGUIs.size(); i++)
|
||||||
m_devSettingsGUIs[i]->accept();
|
m_devSettingsGUIs[i]->accept();
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
#include "ui_SatelliteRadioControlDialog.h"
|
#include "ui_satelliteradiocontroldialog.h"
|
||||||
#include "satellitetrackersettings.h"
|
#include "satellitetrackersettings.h"
|
||||||
#include "satellitedevicesettingsgui.h"
|
#include "satellitedevicesettingsgui.h"
|
||||||
#include "satnogs.h"
|
#include "satnogs.h"
|
||||||
|
@ -651,6 +651,7 @@ void SatelliteTrackerGUI::on_prevPass_clicked()
|
|||||||
|
|
||||||
void SatelliteTrackerGUI::on_chartSelect_currentIndexChanged(int index)
|
void SatelliteTrackerGUI::on_chartSelect_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
|
(void) index;
|
||||||
plotChart();
|
plotChart();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,17 +669,6 @@ static double interpolate(double x0, double y0, double x1, double y1, double x)
|
|||||||
return (y0*(x1-x) + y1*(x-x0)) / (x1-x0);
|
return (y0*(x1-x) + y1*(x-x0)) / (x1-x0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int findClosestPoint(qint64 v, QLineSeries *series)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < series->count(); i++)
|
|
||||||
{
|
|
||||||
if (v < series->at(i).x())
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
return i-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Plot pass in polar coords
|
// Plot pass in polar coords
|
||||||
void SatelliteTrackerGUI::plotPolarChart()
|
void SatelliteTrackerGUI::plotPolarChart()
|
||||||
{
|
{
|
||||||
@ -863,10 +853,11 @@ void SatelliteTrackerGUI::plotPolarChart()
|
|||||||
|
|
||||||
QLineSeries *nowSeries = new QLineSeries();
|
QLineSeries *nowSeries = new QLineSeries();
|
||||||
|
|
||||||
|
QDateTime endTime = currentTime.addSecs(1);
|
||||||
getPassAzEl(nullptr, nullptr, nowSeries,
|
getPassAzEl(nullptr, nullptr, nowSeries,
|
||||||
sat->m_tle->m_tle0, sat->m_tle->m_tle1, sat->m_tle->m_tle2,
|
sat->m_tle->m_tle0, sat->m_tle->m_tle1, sat->m_tle->m_tle2,
|
||||||
m_settings.m_latitude, m_settings.m_longitude, m_settings.m_heightAboveSeaLevel/1000.0,
|
m_settings.m_latitude, m_settings.m_longitude, m_settings.m_heightAboveSeaLevel/1000.0,
|
||||||
currentTime, currentTime.addSecs(1));
|
currentTime, endTime);
|
||||||
|
|
||||||
nowSeries->setPointLabelsFormat(m_settings.m_target);
|
nowSeries->setPointLabelsFormat(m_settings.m_target);
|
||||||
nowSeries->setPointLabelsVisible(true);
|
nowSeries->setPointLabelsVisible(true);
|
||||||
@ -1120,6 +1111,8 @@ void SatelliteTrackerGUI::updateTable(SatelliteState *satState)
|
|||||||
|
|
||||||
void SatelliteTrackerGUI::on_satTable_cellDoubleClicked(int row, int column)
|
void SatelliteTrackerGUI::on_satTable_cellDoubleClicked(int row, int column)
|
||||||
{
|
{
|
||||||
|
(void) column;
|
||||||
|
|
||||||
QString sat = ui->satTable->item(row, SAT_COL_NAME)->text();
|
QString sat = ui->satTable->item(row, SAT_COL_NAME)->text();
|
||||||
FeatureWebAPIUtils::mapFind(sat);
|
FeatureWebAPIUtils::mapFind(sat);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ void getGroundTrack(QDateTime dateTime,
|
|||||||
}
|
}
|
||||||
|
|
||||||
coordinates.clear();
|
coordinates.clear();
|
||||||
while (forward && (currentTime < endTime) || !forward && (currentTime > endTime))
|
while ((forward && (currentTime < endTime)) || (!forward && (currentTime > endTime)))
|
||||||
{
|
{
|
||||||
// Calculate satellite position
|
// Calculate satellite position
|
||||||
Eci eci = sgp4.FindPosition(currentTime);
|
Eci eci = sgp4.FindPosition(currentTime);
|
||||||
@ -133,15 +133,15 @@ void getPassAzEl(QLineSeries* azimuth, QLineSeries* elevation, QLineSeries* pola
|
|||||||
currentTime = currentTime.AddSeconds(timeStep);
|
currentTime = currentTime.AddSeconds(timeStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SatelliteException se)
|
catch (SatelliteException& se)
|
||||||
{
|
{
|
||||||
qDebug() << se.what();
|
qDebug() << se.what();
|
||||||
}
|
}
|
||||||
catch (DecayedException de)
|
catch (DecayedException& de)
|
||||||
{
|
{
|
||||||
qDebug() << de.what();
|
qDebug() << de.what();
|
||||||
}
|
}
|
||||||
catch (TleException tlee)
|
catch (TleException& tlee)
|
||||||
{
|
{
|
||||||
qDebug() << tlee.what();
|
qDebug() << tlee.what();
|
||||||
}
|
}
|
||||||
@ -186,15 +186,15 @@ bool getPassesThrough0Deg(const QString& tle0, const QString& tle1, const QStrin
|
|||||||
currentTime = currentTime.AddSeconds(timeStep);
|
currentTime = currentTime.AddSeconds(timeStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SatelliteException se)
|
catch (SatelliteException& se)
|
||||||
{
|
{
|
||||||
qDebug() << se.what();
|
qDebug() << se.what();
|
||||||
}
|
}
|
||||||
catch (DecayedException de)
|
catch (DecayedException& de)
|
||||||
{
|
{
|
||||||
qDebug() << de.what();
|
qDebug() << de.what();
|
||||||
}
|
}
|
||||||
catch (TleException tlee)
|
catch (TleException& tlee)
|
||||||
{
|
{
|
||||||
qDebug() << tlee.what();
|
qDebug() << tlee.what();
|
||||||
}
|
}
|
||||||
@ -482,15 +482,15 @@ void getSatelliteState(QDateTime dateTime,
|
|||||||
getGroundTrack(dateTime, tle0, tle1, tle2, groundTrackSteps, false, satState->m_groundTrack);
|
getGroundTrack(dateTime, tle0, tle1, tle2, groundTrackSteps, false, satState->m_groundTrack);
|
||||||
getGroundTrack(dateTime, tle0, tle1, tle2, groundTrackSteps, true, satState->m_predictedGroundTrack);
|
getGroundTrack(dateTime, tle0, tle1, tle2, groundTrackSteps, true, satState->m_predictedGroundTrack);
|
||||||
}
|
}
|
||||||
catch (SatelliteException se)
|
catch (SatelliteException& se)
|
||||||
{
|
{
|
||||||
qDebug() << "getSatelliteState: " << satState->m_name << ": " << se.what();
|
qDebug() << "getSatelliteState: " << satState->m_name << ": " << se.what();
|
||||||
}
|
}
|
||||||
catch (DecayedException de)
|
catch (DecayedException& de)
|
||||||
{
|
{
|
||||||
qDebug() << "getSatelliteState: " << satState->m_name << ": " << de.what();
|
qDebug() << "getSatelliteState: " << satState->m_name << ": " << de.what();
|
||||||
}
|
}
|
||||||
catch (TleException tlee)
|
catch (TleException& tlee)
|
||||||
{
|
{
|
||||||
qDebug() << "getSatelliteState: " << satState->m_name << ": " << tlee.what();
|
qDebug() << "getSatelliteState: " << satState->m_name << ": " << tlee.what();
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QLineSeries>
|
|
||||||
#include <QGeoCoordinate>
|
#include <QGeoCoordinate>
|
||||||
|
#include <QtCharts/QLineSeries>
|
||||||
|
|
||||||
using namespace QtCharts;
|
using namespace QtCharts;
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ void SatelliteTrackerWorker::applyDeviceAOSSettings(const QString& name)
|
|||||||
if (preset != nullptr)
|
if (preset != nullptr)
|
||||||
{
|
{
|
||||||
qDebug() << "SatelliteTrackerWorker::aos: Loading preset " << preset->getDescription() << " to " << devSettings->m_deviceSet[0];
|
qDebug() << "SatelliteTrackerWorker::aos: Loading preset " << preset->getDescription() << " to " << devSettings->m_deviceSet[0];
|
||||||
int deviceSetIndex = devSettings->m_deviceSet.mid(1).toInt();
|
unsigned int deviceSetIndex = devSettings->m_deviceSet.mid(1).toInt();
|
||||||
std::vector<DeviceSet*>& deviceSets = mainCore->getDeviceSets();
|
std::vector<DeviceSet*>& deviceSets = mainCore->getDeviceSets();
|
||||||
if (deviceSetIndex < deviceSets.size())
|
if (deviceSetIndex < deviceSets.size())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user