Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
51c774e5
Unverified
Commit
51c774e5
authored
Jun 15, 2019
by
Daniel Agar
Committed by
GitHub
Jun 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake fix build and delete obsolete files
parent
5ac6c722
Changes
53
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
15 additions
and
7499 deletions
+15
-7499
CMakeLists.txt
CMakeLists.txt
+1
-0
CMakeLists.txt
src/CMakeLists.txt
+3
-8
CMakeLists.txt
src/QmlControls/CMakeLists.txt
+0
-1
QmlTestWidget.cc
src/QmlControls/QmlTestWidget.cc
+0
-42
QmlTestWidget.h
src/QmlControls/QmlTestWidget.h
+0
-35
CMakeLists.txt
src/Settings/CMakeLists.txt
+1
-0
CMakeLists.txt
src/ViewWidgets/CMakeLists.txt
+0
-2
CustomCommandWidget.cc
src/ViewWidgets/CustomCommandWidget.cc
+0
-21
CustomCommandWidget.h
src/ViewWidgets/CustomCommandWidget.h
+0
-25
CustomCommandWidgetController.cc
src/ViewWidgets/CustomCommandWidgetController.cc
+0
-66
CMakeLists.txt
src/comm/CMakeLists.txt
+0
-2
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+0
-1017
QGCFlightGearLink.h
src/comm/QGCFlightGearLink.h
+0
-161
CMakeLists.txt
src/qgcunittest/CMakeLists.txt
+6
-6
CMakeLists.txt
src/ui/CMakeLists.txt
+4
-34
HILDockWidget.cc
src/ui/HILDockWidget.cc
+0
-30
HILDockWidget.h
src/ui/HILDockWidget.h
+0
-27
QGCHilConfiguration.cc
src/ui/QGCHilConfiguration.cc
+0
-119
QGCHilConfiguration.h
src/ui/QGCHilConfiguration.h
+0
-42
QGCHilConfiguration.ui
src/ui/QGCHilConfiguration.ui
+0
-75
QGCHilFlightGearConfiguration.cc
src/ui/QGCHilFlightGearConfiguration.cc
+0
-146
QGCHilFlightGearConfiguration.h
src/ui/QGCHilFlightGearConfiguration.h
+0
-54
QGCHilFlightGearConfiguration.ui
src/ui/QGCHilFlightGearConfiguration.ui
+0
-123
QGCHilJSBSimConfiguration.cc
src/ui/QGCHilJSBSimConfiguration.cc
+0
-50
QGCHilJSBSimConfiguration.h
src/ui/QGCHilJSBSimConfiguration.h
+0
-30
QGCHilJSBSimConfiguration.ui
src/ui/QGCHilJSBSimConfiguration.ui
+0
-99
QGCHilXPlaneConfiguration.cc
src/ui/QGCHilXPlaneConfiguration.cc
+0
-82
QGCHilXPlaneConfiguration.h
src/ui/QGCHilXPlaneConfiguration.h
+0
-32
QGCHilXPlaneConfiguration.ui
src/ui/QGCHilXPlaneConfiguration.ui
+0
-92
QGCMAVLinkLogPlayer.cc
src/ui/QGCMAVLinkLogPlayer.cc
+0
-216
QGCMAVLinkLogPlayer.h
src/ui/QGCMAVLinkLogPlayer.h
+0
-57
QGCMAVLinkLogPlayer.ui
src/ui/QGCMAVLinkLogPlayer.ui
+0
-121
QGCUASFileView.cc
src/ui/QGCUASFileView.cc
+0
-280
QGCUASFileView.h
src/ui/QGCUASFileView.h
+0
-65
QGCUASFileView.ui
src/ui/QGCUASFileView.ui
+0
-86
QGCUASFileViewMulti.cc
src/ui/QGCUASFileViewMulti.cc
+0
-75
QGCUASFileViewMulti.h
src/ui/QGCUASFileViewMulti.h
+0
-34
QGCUASFileViewMulti.ui
src/ui/QGCUASFileViewMulti.ui
+0
-27
ChartPlot.cc
src/ui/linechart/ChartPlot.cc
+0
-102
ChartPlot.h
src/ui/linechart/ChartPlot.h
+0
-43
IncrementalPlot.cc
src/ui/linechart/IncrementalPlot.cc
+0
-384
IncrementalPlot.h
src/ui/linechart/IncrementalPlot.h
+0
-118
Linechart.ui
src/ui/linechart/Linechart.ui
+0
-246
LinechartPlot.cc
src/ui/linechart/LinechartPlot.cc
+0
-990
LinechartPlot.h
src/ui/linechart/LinechartPlot.h
+0
-297
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+0
-951
LinechartWidget.h
src/ui/linechart/LinechartWidget.h
+0
-203
Linecharts.cc
src/ui/linechart/Linecharts.cc
+0
-31
Linecharts.h
src/ui/linechart/Linecharts.h
+0
-30
ScrollZoomer.cc
src/ui/linechart/ScrollZoomer.cc
+0
-431
ScrollZoomer.h
src/ui/linechart/ScrollZoomer.h
+0
-74
Scrollbar.cc
src/ui/linechart/Scrollbar.cc
+0
-167
Scrollbar.h
src/ui/linechart/Scrollbar.h
+0
-50
No files found.
CMakeLists.txt
View file @
51c774e5
...
...
@@ -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
...
...
src/CMakeLists.txt
View file @
51c774e5
...
...
@@ -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
)
src/QmlControls/CMakeLists.txt
View file @
51c774e5
...
...
@@ -9,7 +9,6 @@ add_library(QmlControls
QGCImageProvider.cc
QGroundControlQmlGlobal.cc
QmlObjectListModel.cc
QmlTestWidget.cc
RCChannelMonitorController.cc
ScreenToolsController.cc
)
...
...
src/QmlControls/QmlTestWidget.cc
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
);
}
src/QmlControls/QmlTestWidget.h
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
src/Settings/CMakeLists.txt
View file @
51c774e5
...
...
@@ -4,6 +4,7 @@ add_library(Settings
AppSettings.cc
AutoConnectSettings.cc
BrandImageSettings.cc
FirmwareUpgradeSettings.cc
FlightMapSettings.cc
FlyViewSettings.cc
OfflineMapsSettings.cc
...
...
src/ViewWidgets/CMakeLists.txt
View file @
51c774e5
add_library
(
ViewWidgets
CustomCommandWidget.cc
CustomCommandWidgetController.cc
ViewWidgetController.cc
)
...
...
src/ViewWidgets/CustomCommandWidget.cc
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
();
}
src/ViewWidgets/CustomCommandWidget.h
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
);
};
src/ViewWidgets/CustomCommandWidgetController.cc
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
);
}
src/comm/CMakeLists.txt
View file @
51c774e5
...
...
@@ -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
)
...
...
src/comm/QGCFlightGearLink.cc
deleted
100644 → 0
View file @
5ac6c722
This diff is collapsed.
Click to expand it.
src/comm/QGCFlightGearLink.h
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
;
};
src/qgcunittest/CMakeLists.txt
View file @
51c774e5
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
...
...
src/ui/CMakeLists.txt
View file @
51c774e5
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
...
...
src/ui/HILDockWidget.cc
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
);
}
src/ui/HILDockWidget.h
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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
);
};
src/ui/QGCHilConfiguration.cc
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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)));
// }
// }
}
src/ui/QGCHilConfiguration.h
deleted
100644 → 0
View file @
5ac6c722
/****************************************************************************
*
* (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