Unverified Commit 51c774e5 authored by Daniel Agar's avatar Daniel Agar Committed by GitHub

cmake fix build and delete obsolete files

parent 5ac6c722
......@@ -181,6 +181,7 @@ set(QGC_RESOURCES
HackFileDialog.qrc
qgcresources.qrc
qgroundcontrol.qrc
qgcimages.qrc
src/FirmwarePlugin/APM/APMResources.qrc
src/FirmwarePlugin/PX4/PX4Resources.qrc
......
......@@ -72,8 +72,8 @@ add_library(qgc
KMLFileHelper.cc
LogCompressor.cc
main.cc
QGC.cc
QGCApplication.cc
QGC.cc
QGCComboBox.cc
QGCDockWidget.cc
QGCFileDownload.cc
......@@ -81,21 +81,15 @@ add_library(qgc
QGCLoggingCategory.cc
QGCMapPalette.cc
QGCPalette.cc
QGCQFileDialog.cc
QGCQGeoCoordinate.cc
QGCQmlWidgetHolder.cpp
QGCQuickWidget.cc
QGCTemporaryFile.cc
QGCToolbox.cc
RunGuard.cc
ShapeFileHelper.cc
SHPFileHelper.cc
TerrainTile.cc
UTM.cpp
# UI
QGCQmlWidgetHolder.ui
QGCQmlWidgetHolder.h
UTM.cpp
)
set_source_files_properties(QGCApplication.cc PROPERTIES COMPILE_DEFINITIONS GIT_VERSION="${git_tag}")
......@@ -176,3 +170,4 @@ target_include_directories(qgc
${CMAKE_CURRENT_BINARY_DIR}/qgc_autogen/include # HACK: AUTOUIC paths not inheriting?
${CMAKE_CURRENT_BINARY_DIR}/qgc_autogen/include_Debug
)
......@@ -9,7 +9,6 @@ add_library(QmlControls
QGCImageProvider.cc
QGroundControlQmlGlobal.cc
QmlObjectListModel.cc
QmlTestWidget.cc
RCChannelMonitorController.cc
ScreenToolsController.cc
)
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "QmlTestWidget.h"
#include <QColorDialog>
QmlTestWidget::QmlTestWidget(void)
: QGCQmlWidgetHolder(QString(), NULL, NULL)
{
setAttribute(Qt::WA_DeleteOnClose);
resize(900, 500);
setVisible(true);
setContextPropertyObject("controller", this);
setSource(QUrl::fromUserInput("qrc:qml/QmlTest.qml"));
}
void QmlTestWidget::showColorDialog(QQuickItem* item)
{
Q_UNUSED(item)
QColorDialog colorDialog(this);
connect(&colorDialog, &QColorDialog::colorSelected, this, &QmlTestWidget::_colorSelected);
colorDialog.open();
}
void QmlTestWidget::_colorSelected(const QColor & color)
{
Q_UNUSED(color);
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#ifndef QmlTestWidget_h
#define QmlTestWidget_h
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "QGCQmlWidgetHolder.h"
/// This is used to create widgets which are implemented in QML.
class QmlTestWidget : public QGCQmlWidgetHolder
{
Q_OBJECT
public:
QmlTestWidget(void);
Q_INVOKABLE void showColorDialog(QQuickItem* item);
private slots:
void _colorSelected(const QColor & color);
};
#endif
......@@ -4,6 +4,7 @@ add_library(Settings
AppSettings.cc
AutoConnectSettings.cc
BrandImageSettings.cc
FirmwareUpgradeSettings.cc
FlightMapSettings.cc
FlyViewSettings.cc
OfflineMapsSettings.cc
......
add_library(ViewWidgets
CustomCommandWidget.cc
CustomCommandWidgetController.cc
ViewWidgetController.cc
)
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "CustomCommandWidget.h"
CustomCommandWidget::CustomCommandWidget(const QString& title, QAction* action, QWidget *parent) :
QGCQmlWidgetHolder(title, action, parent)
{
Q_UNUSED(title);
Q_UNUSED(action);
setSource(QUrl::fromUserInput("qrc:/qml/CustomCommandWidget.qml"));
loadSettings();
}
/****************************************************************************
*
* (c) 2009-2018 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#pragma once
#include "QGCQmlWidgetHolder.h"
class CustomCommandWidget : public QGCQmlWidgetHolder
{
Q_OBJECT
public:
CustomCommandWidget(const QString& title, QAction* action, QWidget *parent = 0);
};
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "CustomCommandWidgetController.h"
#include "MultiVehicleManager.h"
#include "QGCMAVLink.h"
#include "QGCQFileDialog.h"
#include "UAS.h"
#include "QGCApplication.h"
#include <QSettings>
#include <QUrl>
const char* CustomCommandWidgetController::_settingsKey = "CustomCommand.QmlFile";
CustomCommandWidgetController::CustomCommandWidgetController(void) :
_vehicle(NULL)
{
if(qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()) {
_vehicle = qgcApp()->toolbox()->multiVehicleManager()->activeVehicle();
}
QSettings settings;
_customQmlFile = settings.value(_settingsKey).toString();
}
void CustomCommandWidgetController::sendCommand(int commandId, QVariant componentId, QVariant confirm, QVariant param1, QVariant param2, QVariant param3, QVariant param4, QVariant param5, QVariant param6, QVariant param7)
{
Q_UNUSED(confirm);
if(_vehicle) {
_vehicle->sendMavCommand(componentId.toInt(),
(MAV_CMD)commandId,
true, // show error if fails
param1.toFloat(), param2.toFloat(), param3.toFloat(), param4.toFloat(), param5.toFloat(), param6.toFloat(), param7.toFloat());
}
}
void CustomCommandWidgetController::selectQmlFile(void)
{
QSettings settings;
QString qmlFile = QGCQFileDialog::getOpenFileName(NULL, tr("Select custom Qml file"), QString(), tr("Qml files (*.qml)"));
if (qmlFile.isEmpty()) {
_customQmlFile.clear();
settings.remove(_settingsKey);
} else {
QUrl url = QUrl::fromLocalFile(qmlFile);
_customQmlFile = url.toString();
settings.setValue(_settingsKey, _customQmlFile);
}
emit customQmlFileChanged(_customQmlFile);
}
void CustomCommandWidgetController::clearQmlFile(void)
{
_customQmlFile.clear();
QSettings settings;
settings.remove(_settingsKey);
emit customQmlFileChanged(_customQmlFile);
}
......@@ -16,7 +16,6 @@ add_library(comm
LogReplayLink.cc
MavlinkMessagesTimer.cc
MAVLinkProtocol.cc
QGCFlightGearLink.cc
QGCJSBSimLink.cc
QGCMAVLink.cc
QGCSerialPortInfo.cc
......@@ -30,7 +29,6 @@ add_library(comm
# HEADERS
# shouldn't be listed here, but aren't named properly for AUTOMOC
QGCFlightGearLink.h
QGCHilLink.h
QGCJSBSimLink.h
)
......
This diff is collapsed.
/****************************************************************************
*
* (c) 2009-2018 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/**
* @file
* @brief UDP connection (server) for unmanned vehicles
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#pragma once
#include <QString>
#include <QList>
#include <QMap>
#include <QMutex>
#include <QUdpSocket>
#include <QTimer>
#include <QProcess>
#include "LinkInterface.h"
#include "QGCConfig.h"
#include "UASInterface.h"
#include "QGCHilLink.h"
#include "QGCHilFlightGearConfiguration.h"
#include "Vehicle.h"
class QGCFlightGearLink : public QGCHilLink
{
Q_OBJECT
public:
QGCFlightGearLink(Vehicle* vehicle, QString startupArguments, QString remoteHost=QString("127.0.0.1:49000"), QHostAddress host = QHostAddress::Any, quint16 port = 49005);
~QGCFlightGearLink();
bool isConnected();
qint64 bytesAvailable();
int getPort() const {
return port;
}
/**
* @brief The human readable port name
*/
QString getName();
/**
* @brief Get remote host and port
* @return string in format <host>:<port>
*/
QString getRemoteHost();
QString getVersion()
{
return QString("FlightGear %1").arg(flightGearVersion);
}
int getAirFrameIndex()
{
return -1;
}
bool sensorHilEnabled() {
return _sensorHilEnabled;
}
void sensorHilEnabled(bool sensorHilEnabled) {
_sensorHilEnabled = sensorHilEnabled;
}
static bool parseUIArguments(QString uiArgs, QStringList& argList);
void run();
signals:
void showCriticalMessageFromThread(const QString& title, const QString& message);
public slots:
// void setAddress(QString address);
void setPort(int port);
/** @brief Add a new host to broadcast messages to */
void setRemoteHost(const QString& host);
/** @brief Send new control states to the simulation */
void updateControls(quint64 time, float rollAilerons, float pitchElevator, float yawRudder, float throttle, quint8 systemMode, quint8 navMode);
/** @brief Set the simulator version as text string */
void setVersion(const QString& version)
{
Q_UNUSED(version);
}
void selectAirframe(const QString& airframe)
{
Q_UNUSED(airframe);
}
void enableSensorHIL(bool enable) {
if (enable != _sensorHilEnabled)
_sensorHilEnabled = enable;
emit sensorHilChanged(enable);
}
void readBytes();
private slots:
/**
* @brief Write a number of bytes to the interface.
*
* @param data Pointer to the data byte array
* @param size The size of the bytes array
**/
void _writeBytes(const QByteArray data);
public slots:
bool connectSimulation();
bool disconnectSimulation();
void setStartupArguments(QString startupArguments);
void setBarometerOffset(float barometerOffsetkPa);
void processError(QProcess::ProcessError err);
protected:
void setName(QString name);
private slots:
void _printFgfsOutput(void);
void _printFgfsError(void);
private:
static bool _findUIArgument(const QStringList& uiArgList, const QString& argLabel, QString& argValue);
Vehicle* _vehicle;
QString _fgProcessName; ///< FlightGear process to start
QString _fgProcessWorkingDirPath; ///< Working directory to start FG process in, empty for none
QStringList _fgArgList; ///< Arguments passed to FlightGear process
QUdpSocket* _udpCommSocket; ///< UDP communication sockect between FG and QGC
QProcess* _fgProcess; ///< FlightGear process
QString _fgProtocolFileFullyQualified; ///< Fully qualified file name for protocol file
QString name;
QHostAddress host;
QHostAddress currentHost;
quint16 currentPort;
quint16 port;
int id;
bool connectState;
unsigned int flightGearVersion;
QString startupArguments;
bool _sensorHilEnabled;
float barometerOffsetkPa;
};
add_library(qgcunittest
FileDialogTest.cc
FileManagerTest.cc
FlightGearTest.cc
#FileDialogTest.cc
#FileManagerTest.cc
#FlightGearTest.cc
GeoTest.cc
LinkManagerTest.cc
MainWindowTest.cc
#MainWindowTest.cc
MavlinkLogTest.cc
MessageBoxTest.cc
#MessageBoxTest.cc
MultiSignalSpy.cc
RadioConfigTest.cc
#RadioConfigTest.cc
TCPLinkTest.cc
TCPLoopBackServer.cc
UnitTest.cc
......
add_library(ui
HILDockWidget.cc
linechart/ChartPlot.cc
linechart/IncrementalPlot.cc
linechart/LinechartPlot.cc
linechart/Linecharts.cc
linechart/LinechartWidget.cc
linechart/Scrollbar.cc
linechart/ScrollZoomer.cc
MainWindow.cc
MAVLinkDecoder.cc
MultiVehicleDockWidget.cc
QGCHilConfiguration.cc
QGCHilFlightGearConfiguration.cc
QGCHilJSBSimConfiguration.cc
QGCHilXPlaneConfiguration.cc
QGCMapRCToParamDialog.cpp
QGCMAVLinkLogPlayer.cc
QGCPluginHost.cc
QGCUASFileView.cc
QGCUASFileViewMulti.cc
uas/QGCUnconnectedInfoWidget.cc
# HEADERS
# shouldn't be listed here, but aren't named properly for AUTOMOC
QGCHilFlightGearConfiguration.h
QGCHilJSBSimConfiguration.h
MAVLinkDecoder.h
MultiVehicleDockWidget.h
QGCMapRCToParamDialog.h
QGCPluginHost.h
# UI
MainWindow.ui
MultiVehicleDockWidget.ui
QGCHilConfiguration.ui
QGCHilFlightGearConfiguration.ui
QGCHilJSBSimConfiguration.ui
QGCHilXPlaneConfiguration.ui
QGCMapRCToParamDialog.ui
QGCMAVLinkLogPlayer.ui
QGCPluginHost.ui
QGCUASFileView.ui
QGCUASFileViewMulti.ui
QMap3D.ui
uas/QGCUnconnectedInfoWidget.ui
)
target_link_libraries(ui
PUBLIC
qgc
PRIVATE
qwt
)
target_include_directories(ui
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "HILDockWidget.h"
#include "QGCHilConfiguration.h"
HILDockWidget::HILDockWidget(const QString& title, QAction* action, QWidget *parent)
: MultiVehicleDockWidget(title, action, parent)
{
init();
loadSettings();
}
HILDockWidget::~HILDockWidget()
{
}
QWidget* HILDockWidget::_newVehicleWidget(Vehicle* vehicle, QWidget* parent)
{
return new QGCHilConfiguration(vehicle, parent);
}
/****************************************************************************
*
* (c) 2009-2018 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#pragma once
#include "MultiVehicleDockWidget.h"
class HILDockWidget : public MultiVehicleDockWidget
{
Q_OBJECT
public:
explicit HILDockWidget(const QString& title, QAction* action, QWidget *parent = 0);
~HILDockWidget();
protected:
// Override from MultiVehicleDockWidget
virtual QWidget* _newVehicleWidget(Vehicle* vehicle, QWidget* parent);
};
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include <QSettings>
#include "QGCHilConfiguration.h"
#include "ui_QGCHilConfiguration.h"
#include "QGCHilFlightGearConfiguration.h"
#include "QGCHilJSBSimConfiguration.h"
#include "QGCHilXPlaneConfiguration.h"
#include "UAS.h"
QGCHilConfiguration::QGCHilConfiguration(Vehicle* vehicle, QWidget *parent)
: QWidget(parent)
, _vehicle(vehicle)
, ui(new Ui::QGCHilConfiguration)
{
ui->setupUi(this);
// XXX its quite wrong that this is implicitely a factory
// class, but this is something to clean up for later.
QSettings settings;
settings.beginGroup("QGC_HILCONFIG");
int i = settings.value("SIMULATOR_INDEX", -1).toInt();
if (i > 0) {
// ui->simComboBox->blockSignals(true);
ui->simComboBox->setCurrentIndex(i);
// ui->simComboBox->blockSignals(false);
on_simComboBox_currentIndexChanged(i);
}
settings.endGroup();
}
void QGCHilConfiguration::receiveStatusMessage(const QString& message)
{
ui->statusLabel->setText(message);
}
QGCHilConfiguration::~QGCHilConfiguration()
{
QSettings settings;
settings.beginGroup("QGC_HILCONFIG");
settings.setValue("SIMULATOR_INDEX", ui->simComboBox->currentIndex());
settings.endGroup();
delete ui;
}
void QGCHilConfiguration::setVersion(QString version)
{
Q_UNUSED(version);
}
void QGCHilConfiguration::on_simComboBox_currentIndexChanged(int index)
{
//clean up
QLayoutItem *child;
while ((child = ui->simulatorConfigurationLayout->takeAt(0)) != 0)
{
delete child->widget();
delete child;
}
if(1 == index)
{
// Ensure the sim exists and is disabled
_vehicle->uas()->enableHilFlightGear(false, "", true, this);
QGCHilFlightGearConfiguration* hfgconf = new QGCHilFlightGearConfiguration(_vehicle, this);
hfgconf->show();
ui->simulatorConfigurationLayout->addWidget(hfgconf);
QGCFlightGearLink* fg = dynamic_cast<QGCFlightGearLink*>(_vehicle->uas()->getHILSimulation());
if (fg)
{
connect(fg, &QGCFlightGearLink::statusMessage, ui->statusLabel, &QLabel::setText);
}
}
else if (2 == index || 3 == index)
{
// Ensure the sim exists and is disabled
_vehicle->uas()->enableHilXPlane(false);
QGCHilXPlaneConfiguration* hxpconf = new QGCHilXPlaneConfiguration(_vehicle->uas()->getHILSimulation(), this);
hxpconf->show();
ui->simulatorConfigurationLayout->addWidget(hxpconf);
// Select correct version of XPlane
QGCXPlaneLink* xplane = dynamic_cast<QGCXPlaneLink*>(_vehicle->uas()->getHILSimulation());
if (xplane)
{
xplane->setVersion((index == 2) ? 10 : 9);
connect(xplane, &QGCXPlaneLink::statusMessage, ui->statusLabel, &QLabel::setText);
}
}
// Disabling JSB Sim since its not well maintained,
// but as refactoring is pending we're not ditching the code yet
// else if (4)
// {
// // Ensure the sim exists and is disabled
// _vehicle->uas()->enableHilJSBSim(false, "");
// QGCHilJSBSimConfiguration* hfgconf = new QGCHilJSBSimConfiguration(_vehicle, this);
// hfgconf->show();
// ui->simulatorConfigurationLayout->addWidget(hfgconf);
// QGCJSBSimLink* jsb = dynamic_cast<QGCJSBSimLink*>(_vehicle->uas()->getHILSimulation());
// if (jsb)
// {
// connect(jsb, SIGNAL(statusMessage(QString)), ui->statusLabel, SLOT(setText(QString)));
// }
// }
}
/****************************************************************************
*
* (c) 2009-2018 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#pragma once
#include <QWidget>
#include "Vehicle.h"
namespace Ui {
class QGCHilConfiguration;
}
class QGCHilConfiguration : public QWidget