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
696643ab
Commit
696643ab
authored
Oct 12, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1954 from DonLakeFlyer/NoMobileWidget
Remove Dock Widget code from mobile builds
parents
13a187b8
90105411
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
149 additions
and
793 deletions
+149
-793
QGCApplication.pro
QGCApplication.pro
+41
-47
AutoPilotPlugin.cc
src/AutoPilotPlugins/AutoPilotPlugin.cc
+1
-0
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+1
-0
PowerComponentController.cc
src/AutoPilotPlugins/PX4/PowerComponentController.cc
+1
-0
SensorsComponentController.cc
src/AutoPilotPlugins/PX4/SensorsComponentController.cc
+1
-0
FactPanelController.cc
src/FactSystem/FactControls/FactPanelController.cc
+1
-0
ParameterLoader.cc
src/FactSystem/ParameterLoader.cc
+1
-0
QGCApplication.cc
src/QGCApplication.cc
+2
-13
QGCApplication.h
src/QGCApplication.h
+0
-2
QGCFileDialog.cc
src/QGCFileDialog.cc
+1
-0
main.cc
src/main.cc
+13
-9
MainWindow.cc
src/ui/MainWindow.cc
+73
-72
MainWindow.h
src/ui/MainWindow.h
+11
-20
QGCMainWindowAPConfigurator.cc
src/ui/QGCMainWindowAPConfigurator.cc
+0
-6
QGCMainWindowAPConfigurator.h
src/ui/QGCMainWindowAPConfigurator.h
+0
-18
Linecharts.cc
src/ui/linechart/Linecharts.cc
+1
-1
QGCMAVLinkMessageSender.cc
src/ui/mavlink/QGCMAVLinkMessageSender.cc
+0
-510
QGCMAVLinkMessageSender.h
src/ui/mavlink/QGCMAVLinkMessageSender.h
+0
-52
QGCMAVLinkMessageSender.ui
src/ui/mavlink/QGCMAVLinkMessageSender.ui
+0
-43
MainToolBar.cc
src/ui/toolbar/MainToolBar.cc
+1
-0
No files found.
QGCApplication.pro
View file @
696643ab
...
...
@@ -153,7 +153,6 @@ INCLUDEPATH += \
src
/
ui
/
linechart
\
src
/
ui
/
map
\
src
/
ui
/
mapdisplay
\
src
/
ui
/
mavlink
\
src
/
ui
/
mission
\
src
/
ui
/
px4_configuration
\
src
/
ui
/
toolbar
\
...
...
@@ -166,28 +165,18 @@ FORMS += \
src
/
ui
/
Linechart
.
ui
\
src
/
ui
/
LogReplayLinkConfigurationWidget
.
ui
\
src
/
ui
/
MainWindow
.
ui
\
src
/
ui
/
mavlink
/
QGCMAVLinkMessageSender
.
ui
\
src
/
ui
/
MAVLinkSettingsWidget
.
ui
\
src
/
ui
/
MultiVehicleDockWidget
.
ui
\
src
/
ui
/
QGCCommConfiguration
.
ui
\
src
/
ui
/
QGCDataPlot2D
.
ui
\
src
/
ui
/
QGCLinkConfiguration
.
ui
\
src
/
ui
/
QGCMapRCToParamDialog
.
ui
\
src
/
ui
/
QGCMAVLinkInspector
.
ui
\
src
/
ui
/
QGCMAVLinkLogPlayer
.
ui
\
src
/
ui
/
QGCPluginHost
.
ui
\
src
/
ui
/
QGCTabbedInfoView
.
ui
\
src
/
ui
/
QGCTCPLinkConfiguration
.
ui
\
src
/
ui
/
QGCUASFileView
.
ui
\
src
/
ui
/
QGCUASFileViewMulti
.
ui
\
src
/
ui
/
QGCUDPLinkConfiguration
.
ui
\
src
/
ui
/
SettingsDialog
.
ui
\
src
/
ui
/
uas
/
QGCUnconnectedInfoWidget
.
ui
\
src
/
ui
/
uas
/
UASMessageView
.
ui
\
src
/
ui
/
uas
/
UASQuickView
.
ui
\
src
/
ui
/
uas
/
UASQuickViewItemSelect
.
ui
\
src
/
ui
/
UASInfo
.
ui
\
src
/
ui
/
UASRawStatusView
.
ui
\
!
iOSBuild
{
FORMS
+=
\
...
...
@@ -196,10 +185,19 @@ FORMS += \
!
MobileBuild
{
FORMS
+=
\
src
/
ui
/
MultiVehicleDockWidget
.
ui
\
src
/
ui
/
QGCHilConfiguration
.
ui
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
ui
\
src
/
ui
/
QGCHilJSBSimConfiguration
.
ui
\
src
/
ui
/
QGCHilXPlaneConfiguration
.
ui
\
src
/
ui
/
QGCMAVLinkInspector
.
ui
\
src
/
ui
/
QGCTabbedInfoView
.
ui
\
src
/
ui
/
QGCUASFileView
.
ui
\
src
/
ui
/
QGCUASFileViewMulti
.
ui
\
src
/
ui
/
uas
/
UASQuickView
.
ui
\
src
/
ui
/
uas
/
UASQuickViewItemSelect
.
ui
\
src
/
ui
/
UASInfo
.
ui
\
src
/
ui
/
UASRawStatusView
.
ui
\
}
HEADERS
+=
\
...
...
@@ -232,7 +230,6 @@ HEADERS += \
src
/
QGCApplication
.
h
\
src
/
QGCComboBox
.
h
\
src
/
QGCConfig
.
h
\
src
/
QGCDockWidget
.
h
\
src
/
QGCFileDialog
.
h
\
src
/
QGCGeo
.
h
\
src
/
QGCLoggingCategory
.
h
\
...
...
@@ -263,37 +260,20 @@ HEADERS += \
src
/
ui
/
linechart
/
ScrollZoomer
.
h
\
src
/
ui
/
LogReplayLinkConfigurationWidget
.
h
\
src
/
ui
/
MainWindow
.
h
\
src
/
ui
/
mavlink
/
QGCMAVLinkMessageSender
.
h
\
src
/
ui
/
MAVLinkDecoder
.
h
\
src
/
ui
/
MAVLinkSettingsWidget
.
h
\
src
/
ui
/
MultiVehicleDockWidget
.
h
\
src
/
ui
/
QGCCommConfiguration
.
h
\
src
/
ui
/
QGCDataPlot2D
.
h
\
src
/
ui
/
QGCLinkConfiguration
.
h
\
src
/
ui
/
QGCMainWindowAPConfigurator
.
h
\
src
/
ui
/
QGCMapRCToParamDialog
.
h
\
src
/
ui
/
QGCMAVLinkInspector
.
h
\
src
/
ui
/
QGCMAVLinkLogPlayer
.
h
\
src
/
ui
/
QGCPluginHost
.
h
\
src
/
ui
/
QGCTabbedInfoView
.
h
\
src
/
ui
/
QGCTCPLinkConfiguration
.
h
\
src
/
ui
/
QGCUASFileView
.
h
\
src
/
ui
/
QGCUASFileViewMulti
.
h
\
src
/
ui
/
QGCUDPLinkConfiguration
.
h
\
src
/
ui
/
SettingsDialog
.
h
\
src
/
ui
/
toolbar
/
MainToolBar
.
h
\
src
/
ui
/
uas
/
QGCUnconnectedInfoWidget
.
h
\
src
/
ui
/
uas
/
UASInfoWidget
.
h
\
src
/
ui
/
uas
/
UASMessageView
.
h
\
src
/
ui
/
uas
/
UASQuickView
.
h
\
src
/
ui
/
uas
/
UASQuickViewGaugeItem
.
h
\
src
/
ui
/
uas
/
UASQuickViewItem
.
h
\
src
/
ui
/
uas
/
UASQuickViewItemSelect
.
h
\
src
/
ui
/
uas
/
UASQuickViewTextItem
.
h
\
src
/
ui
/
UASRawStatusView
.
h
\
src
/
ViewWidgets
/
CustomCommandWidget
.
h
\
src
/
ViewWidgets
/
CustomCommandWidgetController
.
h
\
src
/
ViewWidgets
/
ViewWidgetController
.
h
\
src
/
MissionItem
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
PX4AirframeLoader
.
h
...
...
@@ -309,13 +289,29 @@ HEADERS += \
src
/
comm
/
QGCHilLink
.
h
\
src
/
comm
/
QGCJSBSimLink
.
h
\
src
/
comm
/
QGCXPlaneLink
.
h
\
src
/
QGCDockWidget
.
h
\
src
/
ui
/
CameraView
.
h
\
src
/
ui
/
HILDockWidget
.
h
\
src
/
ui
/
MultiVehicleDockWidget
.
h
\
src
/
ui
/
QGCHilConfiguration
.
h
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
h
\
src
/
ui
/
QGCHilJSBSimConfiguration
.
h
\
src
/
ui
/
QGCHilXPlaneConfiguration
.
h
\
src
/
ui
/
QGCMAVLinkInspector
.
h
\
src
/
ui
/
QGCTabbedInfoView
.
h
\
src
/
ui
/
QGCUASFileView
.
h
\
src
/
ui
/
QGCUASFileViewMulti
.
h
\
src
/
ui
/
uas
/
UASInfoWidget
.
h
\
src
/
ui
/
uas
/
UASQuickView
.
h
\
src
/
ui
/
uas
/
UASQuickViewGaugeItem
.
h
\
src
/
ui
/
uas
/
UASQuickViewItem
.
h
\
src
/
ui
/
uas
/
UASQuickViewItemSelect
.
h
\
src
/
ui
/
uas
/
UASQuickViewTextItem
.
h
\
src
/
ui
/
UASRawStatusView
.
h
\
src
/
VehicleSetup
/
JoystickConfigController
.
h
\
src
/
ViewWidgets
/
CustomCommandWidget
.
h
\
src
/
ViewWidgets
/
CustomCommandWidgetController
.
h
\
src
/
ViewWidgets
/
ViewWidgetController
.
h
\
}
SOURCES
+=
\
...
...
@@ -344,7 +340,6 @@ SOURCES += \
src
/
QGC
.
cc
\
src
/
QGCApplication
.
cc
\
src
/
QGCComboBox
.
cc
\
src
/
QGCDockWidget
.
cc
\
src
/
QGCFileDialog
.
cc
\
src
/
QGCLoggingCategory
.
cc
\
src
/
QGCPalette
.
cc
\
...
...
@@ -370,37 +365,20 @@ SOURCES += \
src
/
ui
/
linechart
/
ScrollZoomer
.
cc
\
src
/
ui
/
LogReplayLinkConfigurationWidget
.
cc
\
src
/
ui
/
MainWindow
.
cc
\
src
/
ui
/
mavlink
/
QGCMAVLinkMessageSender
.
cc
\
src
/
ui
/
MAVLinkDecoder
.
cc
\
src
/
ui
/
MAVLinkSettingsWidget
.
cc
\
src
/
ui
/
MultiVehicleDockWidget
.
cc
\
src
/
ui
/
QGCCommConfiguration
.
cc
\
src
/
ui
/
QGCDataPlot2D
.
cc
\
src
/
ui
/
QGCLinkConfiguration
.
cc
\
src
/
ui
/
QGCMainWindowAPConfigurator
.
cc
\
src
/
ui
/
QGCMapRCToParamDialog
.
cpp
\
src
/
ui
/
QGCMAVLinkInspector
.
cc
\
src
/
ui
/
QGCMAVLinkLogPlayer
.
cc
\
src
/
ui
/
QGCPluginHost
.
cc
\
src
/
ui
/
QGCTabbedInfoView
.
cpp
\
src
/
ui
/
QGCTCPLinkConfiguration
.
cc
\
src
/
ui
/
QGCUASFileView
.
cc
\
src
/
ui
/
QGCUASFileViewMulti
.
cc
\
src
/
ui
/
QGCUDPLinkConfiguration
.
cc
\
src
/
ui
/
SettingsDialog
.
cc
\
src
/
ui
/
toolbar
/
MainToolBar
.
cc
\
src
/
ui
/
uas
/
QGCUnconnectedInfoWidget
.
cc
\
src
/
ui
/
uas
/
UASInfoWidget
.
cc
\
src
/
ui
/
uas
/
UASMessageView
.
cc
\
src
/
ui
/
uas
/
UASQuickView
.
cc
\
src
/
ui
/
uas
/
UASQuickViewGaugeItem
.
cc
\
src
/
ui
/
uas
/
UASQuickViewItem
.
cc
\
src
/
ui
/
uas
/
UASQuickViewItemSelect
.
cc
\
src
/
ui
/
uas
/
UASQuickViewTextItem
.
cc
\
src
/
ui
/
UASRawStatusView
.
cpp
\
src
/
ViewWidgets
/
CustomCommandWidget
.
cc
\
src
/
ViewWidgets
/
CustomCommandWidgetController
.
cc
\
src
/
ViewWidgets
/
ViewWidgetController
.
cc
\
src
/
MissionItem
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
PX4AirframeLoader
.
cc
...
...
@@ -415,13 +393,29 @@ SOURCES += \
src
/
comm
/
QGCFlightGearLink
.
cc
\
src
/
comm
/
QGCJSBSimLink
.
cc
\
src
/
comm
/
QGCXPlaneLink
.
cc
\
src
/
QGCDockWidget
.
cc
\
src
/
ui
/
CameraView
.
cc
\
src
/
ui
/
HILDockWidget
.
cc
\
src
/
ui
/
MultiVehicleDockWidget
.
cc
\
src
/
ui
/
QGCHilConfiguration
.
cc
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
cc
\
src
/
ui
/
QGCHilJSBSimConfiguration
.
cc
\
src
/
ui
/
QGCHilXPlaneConfiguration
.
cc
\
src
/
ui
/
QGCMAVLinkInspector
.
cc
\
src
/
ui
/
QGCTabbedInfoView
.
cpp
\
src
/
ui
/
QGCUASFileView
.
cc
\
src
/
ui
/
QGCUASFileViewMulti
.
cc
\
src
/
ui
/
uas
/
UASInfoWidget
.
cc
\
src
/
ui
/
uas
/
UASQuickView
.
cc
\
src
/
ui
/
uas
/
UASQuickViewGaugeItem
.
cc
\
src
/
ui
/
uas
/
UASQuickViewItem
.
cc
\
src
/
ui
/
uas
/
UASQuickViewItemSelect
.
cc
\
src
/
ui
/
uas
/
UASQuickViewTextItem
.
cc
\
src
/
ui
/
UASRawStatusView
.
cpp
\
src
/
VehicleSetup
/
JoystickConfigController
.
cc
\
src
/
ViewWidgets
/
CustomCommandWidget
.
cc
\
src
/
ViewWidgets
/
CustomCommandWidgetController
.
cc
\
src
/
ViewWidgets
/
ViewWidgetController
.
cc
\
}
#
...
...
src/AutoPilotPlugins/AutoPilotPlugin.cc
View file @
696643ab
...
...
@@ -29,6 +29,7 @@
#include "QGCMessageBox.h"
#include "MainWindow.h"
#include "ParameterLoader.h"
#include "UAS.h"
AutoPilotPlugin
::
AutoPilotPlugin
(
Vehicle
*
vehicle
,
QObject
*
parent
)
:
QObject
(
parent
)
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
696643ab
...
...
@@ -28,6 +28,7 @@
#include "FlightModesComponentController.h"
#include "AirframeComponentController.h"
#include "QGCMessageBox.h"
#include "UAS.h"
/// @file
/// @brief This is the AutoPilotPlugin implementatin for the MAV_AUTOPILOT_PX4 type.
...
...
src/AutoPilotPlugins/PX4/PowerComponentController.cc
View file @
696643ab
...
...
@@ -27,6 +27,7 @@
#include "PowerComponentController.h"
#include "QGCMAVLink.h"
#include "QGCMessageBox.h"
#include "UAS.h"
#include <QVariant>
#include <QQmlProperty>
...
...
src/AutoPilotPlugins/PX4/SensorsComponentController.cc
View file @
696643ab
...
...
@@ -27,6 +27,7 @@
#include "SensorsComponentController.h"
#include "QGCMAVLink.h"
#include "QGCMessageBox.h"
#include "UAS.h"
#include <QVariant>
#include <QQmlProperty>
...
...
src/FactSystem/FactControls/FactPanelController.cc
View file @
696643ab
...
...
@@ -24,6 +24,7 @@
#include "FactPanelController.h"
#include "MultiVehicleManager.h"
#include "QGCMessageBox.h"
#include "UAS.h"
#include <QQmlEngine>
...
...
src/FactSystem/ParameterLoader.cc
View file @
696643ab
...
...
@@ -31,6 +31,7 @@
#include "QGCMessageBox.h"
#include "UASMessageHandler.h"
#include "FirmwarePlugin.h"
#include "UAS.h"
#include <QFile>
#include <QDebug>
...
...
src/QGCApplication.cc
View file @
696643ab
...
...
@@ -163,9 +163,6 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
,
_runningUnitTests
(
unitTesting
)
,
_styleIsDark
(
true
)
,
_fakeMobile
(
false
)
#ifdef UNITTEST_BUILD
,
_useNewMissionEditor
(
true
)
// Unit Tests run new mission editor
#endif
#ifdef QT_DEBUG
,
_testHighDPI
(
false
)
#endif
...
...
@@ -337,9 +334,7 @@ void QGCApplication::_initCommon(void)
qmlRegisterUncreatableType
<
QGCQGeoCoordinate
>
(
"QGroundControl"
,
1
,
0
,
"QGCQGeoCoordinate"
,
"Reference only"
);
qmlRegisterUncreatableType
<
CoordinateVector
>
(
"QGroundControl"
,
1
,
0
,
"CoordinateVector"
,
"Reference only"
);
qmlRegisterType
<
ViewWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ViewWidgetController"
);
qmlRegisterType
<
ParameterEditorController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ParameterEditorController"
);
qmlRegisterType
<
CustomCommandWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"CustomCommandWidgetController"
);
qmlRegisterType
<
FlightModesComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FlightModesComponentController"
);
qmlRegisterType
<
AirframeComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"AirframeComponentController"
);
qmlRegisterType
<
SensorsComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"SensorsComponentController"
);
...
...
@@ -348,6 +343,8 @@ void QGCApplication::_initCommon(void)
qmlRegisterType
<
ScreenToolsController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ScreenToolsController"
);
#ifndef __mobile__
qmlRegisterType
<
ViewWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ViewWidgetController"
);
qmlRegisterType
<
CustomCommandWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"CustomCommandWidgetController"
);
qmlRegisterType
<
FirmwareUpgradeController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"FirmwareUpgradeController"
);
qmlRegisterType
<
JoystickConfigController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"JoystickConfigController"
);
#endif
...
...
@@ -420,14 +417,6 @@ bool QGCApplication::_initForNormalAppBoot(void)
_styleIsDark
=
settings
.
value
(
_styleKey
,
_styleIsDark
).
toBool
();
_loadCurrentStyle
();
// Temp hack for new mission editor
#ifdef __mobile__
// Mobile builds always use new Mission Editor
_useNewMissionEditor
=
true
;
#else
_useNewMissionEditor
=
settings
.
value
(
"UseNewMissionEditor"
,
false
).
toBool
();
#endif
// Show splash screen
QPixmap
splashImage
(
":/res/SplashScreen"
);
QSplashScreen
*
splashScreen
=
new
QSplashScreen
(
splashImage
);
...
...
src/QGCApplication.h
View file @
696643ab
...
...
@@ -178,8 +178,6 @@ private:
QStringList
_missingParams
;
///< List of missing facts to be displayed
bool
_fakeMobile
;
///< true: Fake ui into displaying mobile interface
bool
_useNewMissionEditor
;
///< true: Use new Mission Editor
#ifdef QT_DEBUG
bool
_testHighDPI
;
///< true: double fonts sizes for simulating high dpi devices
...
...
src/QGCFileDialog.cc
View file @
696643ab
...
...
@@ -32,6 +32,7 @@
#include <QRegularExpression>
#include <QMessageBox>
#include <QPushButton>
QString
QGCFileDialog
::
getExistingDirectory
(
QWidget
*
parent
,
...
...
src/main.cc
View file @
696643ab
...
...
@@ -31,21 +31,25 @@ This file is part of the QGROUNDCONTROL project
#include <QtGlobal>
#include <QApplication>
#include <QSslSocket>
#include <QProcessEnvironment>
#ifndef __mobile__
#include <QSerialPortInfo>
#include <QSerialPortInfo>
#endif
#include <QProcessEnvironment>
#include "QGCApplication.h"
#include "MainWindow.h"
#ifdef QT_DEBUG
#ifndef __mobile__
#include "UnitTest.h"
#endif
#include "CmdLineOptParser.h"
#ifdef Q_OS_WIN
#include <crtdbg.h>
#endif
#ifndef __mobile__
#include "UnitTest.h"
#endif
#include "CmdLineOptParser.h"
#ifdef Q_OS_WIN
#include <crtdbg.h>
#endif
#endif
#include <iostream>
/* SDL does ugly things to main() */
...
...
src/ui/MainWindow.cc
View file @
696643ab
...
...
@@ -33,11 +33,11 @@ This file is part of the QGROUNDCONTROL project
#include <QTimer>
#include <QHostInfo>
#include <QSplashScreen>
#include <QQuickView>
#include <QDesktopWidget>
#include <QScreen>
#include <QDesktopServices>
#include <QDockWidget>
#include "QGC.h"
#include "MAVLinkProtocol.h"
...
...
@@ -46,27 +46,28 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLinkLogPlayer.h"
#include "SettingsDialog.h"
#include "MAVLinkDecoder.h"
#include "QGCMAVLinkMessageSender.h"
#include "UASQuickView.h"
#include "QGCDataPlot2D.h"
#include "Linecharts.h"
#include "QGCTabbedInfoView.h"
#include "UASRawStatusView.h"
#include "FlightDisplayView.h"
#include "FlightDisplayWidget.h"
#include "SetupView.h"
#include "QGCUASFileViewMulti.h"
#include "QGCApplication.h"
#include "QGCFileDialog.h"
#include "QGCMessageBox.h"
#include "QGCDockWidget.h"
#include "MultiVehicleManager.h"
#include "CustomCommandWidget.h"
#include "HomePositionManager.h"
#include "MissionEditor.h"
#include "LogCompressor.h"
#include "UAS.h"
#ifndef __mobile__
#include "QGCUASFileViewMulti.h"
#include "UASQuickView.h"
#include "QGCTabbedInfoView.h"
#include "UASRawStatusView.h"
#include "CustomCommandWidget.h"
#include "QGCDockWidget.h"
#include "FlightDisplayWidget.h"
#include "UASInfoWidget.h"
#include "HILDockWidget.h"
#endif
...
...
@@ -86,6 +87,7 @@ This file is part of the QGROUNDCONTROL project
/// The key under which the Main Window settings are saved
const
char
*
MAIN_SETTINGS_GROUP
=
"QGC_MAINWINDOW"
;
#ifndef __mobile__
const
char
*
MainWindow
::
_mavlinkDockWidgetName
=
"MAVLINK_INSPECTOR_DOCKWIDGET"
;
const
char
*
MainWindow
::
_customCommandWidgetName
=
"CUSTOM_COMMAND_DOCKWIDGET"
;
const
char
*
MainWindow
::
_filesDockWidgetName
=
"FILE_VIEW_DOCKWIDGET"
;
...
...
@@ -94,6 +96,7 @@ const char* MainWindow::_mapViewDockWidgetName = "MAP_VIEW_DOCKWIDGET";
const
char
*
MainWindow
::
_pfdDockWidgetName
=
"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET"
;
const
char
*
MainWindow
::
_uasInfoViewDockWidgetName
=
"UAS_INFO_INFOVIEW_DOCKWIDGET"
;
const
char
*
MainWindow
::
_hilDockWidgetName
=
"HIL_DOCKWIDGET"
;
#endif
static
MainWindow
*
_instance
=
NULL
;
///< @brief MainWindow singleton
...
...
@@ -162,10 +165,12 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
menuBar
()
->
setNativeMenuBar
(
false
);
#endif
#ifndef __mobile__
#ifdef UNITTEST_BUILD
QAction
*
qmlTestAction
=
new
QAction
(
"Test QML palette and controls"
,
NULL
);
connect
(
qmlTestAction
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
_showQmlTestWidget
);
_ui
.
menuWidgets
->
addAction
(
qmlTestAction
);
#endif
#endif
// Load QML Toolbar
...
...
@@ -184,9 +189,12 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
setStatusBar
(
new
QStatusBar
(
this
));
statusBar
()
->
setSizeGripEnabled
(
true
);
#ifndef __mobile__
emit
initStatusChanged
(
tr
(
"Building common widgets."
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
_buildCommonWidgets
();
emit
initStatusChanged
(
tr
(
"Building common actions"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
#endif
// Create actions
connectCommonActions
();
// Connect user interface devices
...
...
@@ -332,6 +340,7 @@ QString MainWindow::_getWindowGeometryKey()
return
"_geometry"
;
}
#ifndef __mobile__
void
MainWindow
::
_createDockWidget
(
const
QString
&
title
,
const
QString
&
name
,
Qt
::
DockWidgetArea
area
,
QWidget
*
innerWidget
)
{
Q_ASSERT
(
!
_mapName2DockWidget
.
contains
(
name
));
...
...
@@ -401,46 +410,6 @@ void MainWindow::_buildCommonWidgets(void)
}
}
void
MainWindow
::
_buildMissionEditorView
(
void
)
{
if
(
!
_missionEditorView
)
{
_missionEditorView
=
new
MissionEditor
(
this
);
_missionEditorView
->
setVisible
(
false
);
}
}
void
MainWindow
::
_buildFlightView
(
void
)
{
if
(
!
_flightView
)
{
_flightView
=
new
FlightDisplayView
(
this
);
_flightView
->
setVisible
(
false
);
}
}
void
MainWindow
::
_buildSetupView
(
void
)
{
if
(
!
_setupView
)
{
_setupView
=
new
SetupView
(
this
);
_setupView
->
setVisible
(
false
);
}
}
void
MainWindow
::
_buildAnalyzeView
(
void
)
{
if
(
!
_analyzeView
)
{
_analyzeView
=
new
QGCDataPlot2D
(
this
);
_analyzeView
->
setVisible
(
false
);
}
}
void
MainWindow
::
_buildSimView
(
void
)
{
if
(
!
_simView
)
{
_simView
=
new
FlightDisplayView
(
this
);
_simView
->
setVisible
(
false
);
}
}
/// Shows or hides the specified dock widget, creating if necessary
void
MainWindow
::
_showDockWidget
(
const
QString
&
name
,
bool
show
)
{
...
...
@@ -449,18 +418,18 @@ void MainWindow::_showDockWidget(const QString& name, bool show)
// Which would cause us to end up here.
return
;
}
// Create the inner widget if we need to
if
(
!
_mapName2DockWidget
[
name
]
->
widget
())
{
_createInnerDockWidget
(
name
);
}
Q_ASSERT
(
_mapName2DockWidget
.
contains
(
name
));
QDockWidget
*
dockWidget
=
_mapName2DockWidget
[
name
];
Q_ASSERT
(
dockWidget
);
dockWidget
->
setVisible
(
show
);
Q_ASSERT
(
_mapDockWidget2Action
.
contains
(
dockWidget
));
_mapDockWidget2Action
[
dockWidget
]
->
setChecked
(
show
);
}
...
...
@@ -470,9 +439,9 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
{
Q_ASSERT
(
_mapName2DockWidget
.
contains
(
widgetName
));
// QDockWidget should already exist
Q_ASSERT
(
!
_mapName2DockWidget
[
widgetName
]
->
widget
());
// Inner widget should not
QWidget
*
widget
=
NULL
;
if
(
widgetName
==
_mavlinkDockWidgetName
)
{
widget
=
new
QGCMAVLinkInspector
(
MAVLinkProtocol
::
instance
(),
this
);
}
else
if
(
widgetName
==
_customCommandWidgetName
)
{
...
...
@@ -494,7 +463,7 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
}
else
{
qWarning
()
<<
"Attempt to create unknown Inner Dock Widget"
<<
widgetName
;
}
if
(
widget
)
{
QDockWidget
*
dockWidget
=
_mapName2DockWidget
[
widgetName
];
Q_CHECK_PTR
(
dockWidget
);
...
...
@@ -503,6 +472,53 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
}
}
void
MainWindow
::
_hideAllDockWidgets
(
void
)
{
foreach
(
QDockWidget
*
dockWidget
,
_mapName2DockWidget
)
{
dockWidget
->
setVisible
(
false
);
}
}
void
MainWindow
::
_showDockWidgetAction
(
bool
show
)
{
QAction
*
action
=
dynamic_cast
<
QAction
*>
(
QObject
::
sender
());
Q_ASSERT
(
action
);
_showDockWidget
(
action
->
data
().
toString
(),
show
);
}
#endif
void
MainWindow
::
_buildMissionEditorView
(
void
)
{
if
(
!
_missionEditorView
)
{
_missionEditorView
=
new
MissionEditor
(
this
);
_missionEditorView
->
setVisible
(
false
);
}
}
void
MainWindow
::
_buildFlightView
(
void
)
{
if
(
!
_flightView
)
{
_flightView
=
new
FlightDisplayView
(
this
);
_flightView
->
setVisible
(
false
);
}
}
void
MainWindow
::
_buildSetupView
(
void
)
{
if
(
!
_setupView
)
{
_setupView
=
new
SetupView
(
this
);
_setupView
->
setVisible
(
false
);
}
}
void
MainWindow
::
_buildAnalyzeView
(
void
)
{
if
(
!
_analyzeView
)
{
_analyzeView
=
new
QGCDataPlot2D
(
this
);
_analyzeView
->
setVisible
(
false
);
}
}
void
MainWindow
::
fullScreenActionItemCallback
(
bool
)
{
_ui
.
actionNormal
->
setChecked
(
false
);
...
...
@@ -804,10 +820,10 @@ void MainWindow::_loadCurrentViewState(void)
_centralLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
_currentViewWidget
->
setVisible
(
true
);
#ifndef __mobile__
// Hide all widgets from previous view
_hideAllDockWidgets
();
#ifndef __mobile__
// Restore the widgets for the new view
QString
widgetNames
=
settings
.
value
(
_getWindowStateKey
()
+
"WIDGETS"
,
defaultWidgets
).
toString
();
qDebug
()
<<
widgetNames
;
...
...
@@ -829,21 +845,6 @@ void MainWindow::_loadCurrentViewState(void)
emit
repaintCanvas
();
}
void
MainWindow
::
_hideAllDockWidgets
(
void
)
{
foreach
(
QDockWidget
*
dockWidget
,
_mapName2DockWidget
)
{
dockWidget
->
setVisible
(
false
);
}
}
void
MainWindow
::
_showDockWidgetAction
(
bool
show
)
{
QAction
*
action
=
dynamic_cast
<
QAction
*>
(
QObject
::
sender
());
Q_ASSERT
(
action
);
_showDockWidget
(
action
->
data
().
toString
(),
show
);
}
void
MainWindow
::
loadAnalyzeView
()
{
if
(
_currentView
!=
VIEW_ANALYZE
)
...
...
src/ui/MainWindow.h
View file @
696643ab
...
...
@@ -41,7 +41,6 @@ This file is part of the QGROUNDCONTROL project
#include "LinkManager.h"
#include "LinkInterface.h"
#include "UASInterface.h"
#include "UASInfoWidget.h"
#include "CameraView.h"
#if (defined QGC_MOUSE_ENABLED_WIN) | (defined QGC_MOUSE_ENABLED_LINUX)
#include "Mouse6dofInput.h"
...
...
@@ -53,16 +52,13 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLinkInspector.h"
#include "QGCMAVLinkLogPlayer.h"
#include "MAVLinkDecoder.h"
#include "QGCUASFileViewMulti.h"
#include "Vehicle.h"
class
QGCMAVLinkMessageSender
;
class
QGCFirmwareUpdate
;
class
QSplashScreen
;
class
QGCStatusBar
;
class
Linecharts
;
class
QGCDataPlot2D
;
class
QGCUASFileViewMulti
;
/**
* @brief Main Application Window
...
...
@@ -212,19 +208,11 @@ protected:
// Center widgets
QPointer
<
Linecharts
>
linechartWidget
;
#ifdef QGC_OSG_ENABLED
QPointer
<
QWidget
>
q3DWidget
;
#endif
QPointer
<
QGCFirmwareUpdate
>
firmwareUpdateWidget
;
QPointer
<
MainToolBar
>
_mainToolBar
;
QPointer
<
QDockWidget
>
mavlinkInspectorWidget
;
QPointer
<
MAVLinkDecoder
>
mavlinkDecoder
;
QPointer
<
QDockWidget
>
mavlinkSenderWidget
;
QGCMAVLinkLogPlayer
*
logPlayer
;
QPointer
<
QGCUASFileViewMulti
>
fileWidget
;
#ifdef QGC_MOUSE_ENABLED_WIN
/** @brief 3d Mouse support (WIN only) */
Mouse3DInput
*
mouseInput
;
///< 3dConnexion 3dMouse SDK
...
...
@@ -251,15 +239,17 @@ protected:
QTimer
windowNameUpdateTimer
;
private
slots
:
void
_showDockWidgetAction
(
bool
show
);
void
_linkStateChange
(
LinkInterface
*
);
void
_closeWindow
(
void
)
{
close
();
}
void
_vehicleAdded
(
Vehicle
*
vehicle
);
#ifndef __mobile__
void
_showDockWidgetAction
(
bool
show
);
#endif
#ifdef UNITTEST_BUILD
void
_showQmlTestWidget
(
void
);
#endif
void
_closeWindow
(
void
)
{
close
();
}
private
slots
:
void
_vehicleAdded
(
Vehicle
*
vehicle
);
private:
/// Constructor is private since all creation should be through MainWindow::_create
...
...
@@ -272,10 +262,9 @@ private:
QPointer
<
QWidget
>
_flightView
;
QPointer
<
QWidget
>
_setupView
;
QPointer
<
QWidget
>
_analyzeView
;
QPointer
<
QWidget
>
_simView
;
QPointer
<
QWidget
>
_terminalView
;
QPointer
<
QWidget
>
_missionEditorView
;
#ifndef __mobile__
// Dock widget names
static
const
char
*
_mavlinkDockWidgetName
;
static
const
char
*
_customCommandWidgetName
;
...
...
@@ -288,23 +277,25 @@ private:
QMap
<
QString
,
QDockWidget
*>
_mapName2DockWidget
;
QMap
<
QDockWidget
*
,
QAction
*>
_mapDockWidget2Action
;
#endif
void
_buildPlanView
(
void
);
void
_buildFlightView
(
void
);
void
_buildSetupView
(
void
);
void
_buildAnalyzeView
(
void
);
void
_buildSimView
(
void
);
void
_buildTerminalView
(
void
);
void
_buildMissionEditorView
(
void
);
void
_storeCurrentViewState
(
void
);
void
_loadCurrentViewState
(
void
);
#ifndef __mobile__
void
_createDockWidget
(
const
QString
&
title
,
const
QString
&
name
,
Qt
::
DockWidgetArea
area
,
QWidget
*
innerWidget
);
void
_createInnerDockWidget
(
const
QString
&
widgetName
);
void
_buildCommonWidgets
(
void
);
void
_hideAllDockWidgets
(
void
);
void
_showDockWidget
(
const
QString
&
name
,
bool
show
);
#endif
bool
_autoReconnect
;
bool
_lowPowerMode
;
///< If enabled, QGC reduces the update rates of all widgets
...
...
src/ui/QGCMainWindowAPConfigurator.cc
deleted
100644 → 0
View file @
13a187b8
#include "QGCMainWindowAPConfigurator.h"
QGCMainWindowAPConfigurator
::
QGCMainWindowAPConfigurator
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
src/ui/QGCMainWindowAPConfigurator.h
deleted
100644 → 0
View file @
13a187b8
#ifndef QGCMAINWINDOWAPCONFIGURATOR_H
#define QGCMAINWINDOWAPCONFIGURATOR_H
#include <QObject>
class
QGCMainWindowAPConfigurator
:
public
QObject
{
Q_OBJECT
public:
explicit
QGCMainWindowAPConfigurator
(
QObject
*
parent
=
0
);
signals:
public
slots
:
};
#endif // QGCMAINWINDOWAPCONFIGURATOR_H
src/ui/linechart/Linecharts.cc
View file @
696643ab
...
...
@@ -2,8 +2,8 @@
#include "Linecharts.h"
#include "MultiVehicleManager.h"
#include "MainWindow.h"
#include "UAS.h"
Linecharts
::
Linecharts
(
QWidget
*
parent
)
:
QStackedWidget
(
parent
),
...
...
src/ui/mavlink/QGCMAVLinkMessageSender.cc
deleted
100644 → 0
View file @
13a187b8
#include "QGCMAVLinkMessageSender.h"
#include "ui_QGCMAVLinkMessageSender.h"
#include "MAVLinkProtocol.h"
QGCMAVLinkMessageSender
::
QGCMAVLinkMessageSender
(
MAVLinkProtocol
*
mavlink
,
QWidget
*
parent
)
:
QWidget
(
parent
),
protocol
(
mavlink
),
ui
(
new
Ui
::
QGCMAVLinkMessageSender
)
{
ui
->
setupUi
(
this
);
mavlink_message_info_t
msg
[
256
]
=
MAVLINK_MESSAGE_INFO
;
memcpy
(
messageInfo
,
msg
,
sizeof
(
mavlink_message_info_t
)
*
256
);
QStringList
header
;
header
<<
tr
(
"Name"
);
header
<<
tr
(
"Value"
);
header
<<
tr
(
"Type"
);
ui
->
treeWidget
->
setHeaderLabels
(
header
);
createTreeView
();
connect
(
&
refreshTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
refresh
()));
//refreshTimer.start(1000); // Refresh at 1 Hz interval
connect
(
ui
->
sendButton
,
SIGNAL
(
pressed
()),
this
,
SLOT
(
sendMessage
()));
}
void
QGCMAVLinkMessageSender
::
refresh
()
{
// Send messages
foreach
(
unsigned
int
i
,
managementItems
.
keys
())
{
if
(
!
sendTimers
.
contains
(
i
))
{
//sendTimers.insert(i, new QTimer())
}
}
// ui->treeWidget->topLevelItem(0)->children();
}
bool
QGCMAVLinkMessageSender
::
sendMessage
()
{
return
sendMessage
(
ui
->
messageIdSpinBox
->
value
());
}
bool
QGCMAVLinkMessageSender
::
sendMessage
(
unsigned
int
msgid
)
{
QString
msgname
(
messageInfo
[
msgid
].
name
);
if
(
msgid
==
0
||
msgid
>
255
||
messageInfo
[
msgid
].
name
==
NULL
||
msgname
.
compare
(
QString
(
"EMPTY"
)))
{
return
false
;
}
bool
result
=
true
;
if
(
treeWidgetItems
.
contains
(
msgid
))
{
// Fill message fields
mavlink_message_t
msg
;
QList
<
QTreeWidgetItem
*>
fields
;
// = treeWidgetItems.value(msgid)->;
for
(
unsigned
int
i
=
0
;
i
<
messageInfo
[
msgid
].
num_fields
;
++
i
)
{
QTreeWidgetItem
*
field
=
fields
.
at
(
i
);
int
fieldid
=
i
;
uint8_t
*
m
=
((
uint8_t
*
)(
&
msg
))
+
8
;
switch
(
messageInfo
[
msgid
].
fields
[
fieldid
].
type
)
{
case
MAVLINK_TYPE_CHAR
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
char
*
str
=
(
char
*
)(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
// Copy data
QString
string
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
();
// Copy string size
int
len
=
qMin
((
unsigned
int
)
string
.
length
(),
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
);
memcpy
(
str
,
string
.
toStdString
().
c_str
(),
len
);
// Enforce null termination
str
[
len
-
1
]
=
'\0'
;
}
else
{
// Single char
char
*
b
=
((
char
*
)(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
));
*
b
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
toLatin1
();
}
break
;
case
MAVLINK_TYPE_UINT8_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
uint8_t
*
nums
=
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
((
unsigned
int
)(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
())
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toInt
();
}
}
}
else
{
// Single value
uint8_t
*
u
=
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
toLatin1
();
}
break
;
case
MAVLINK_TYPE_INT8_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
int8_t
*
nums
=
reinterpret_cast
<
int8_t
*>
((
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
));
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
((
unsigned
int
)(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
())
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toInt
();
}
}
}
else
{
// Single value
int8_t
*
u
=
reinterpret_cast
<
int8_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
toLatin1
();
}
break
;
case
MAVLINK_TYPE_INT16_T
:
case
MAVLINK_TYPE_UINT16_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
uint16_t
*
nums
=
reinterpret_cast
<
uint16_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
((
unsigned
int
)(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
())
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toUInt
();
}
}
}
else
{
// Single value
uint16_t
*
u
=
reinterpret_cast
<
uint16_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toUInt
();
}
break
;
case
MAVLINK_TYPE_INT32_T
:
case
MAVLINK_TYPE_UINT32_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
int32_t
*
nums
=
reinterpret_cast
<
int32_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
((
unsigned
int
)(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
())
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toUInt
();
}
}
}
else
{
// Single value
int32_t
*
u
=
reinterpret_cast
<
int32_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toUInt
();
}
break
;
case
MAVLINK_TYPE_INT64_T
:
case
MAVLINK_TYPE_UINT64_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
int64_t
*
nums
=
reinterpret_cast
<
int64_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
((
unsigned
int
)(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
())
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toULongLong
();
}
}
}
else
{
// Single value
int64_t
*
u
=
reinterpret_cast
<
int64_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toULongLong
();
}
break
;
case
MAVLINK_TYPE_FLOAT
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
float
*
nums
=
reinterpret_cast
<
float
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
((
unsigned
int
)(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
())
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toFloat
();
}
}
}
else
{
// Single value
float
*
u
=
reinterpret_cast
<
float
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toFloat
();
}
break
;
case
MAVLINK_TYPE_DOUBLE
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
double
*
nums
=
reinterpret_cast
<
double
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
if
((
unsigned
int
)(
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
size
())
>
j
)
{
nums
[
j
]
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toString
().
split
(
" "
).
at
(
j
).
toDouble
();
}
}
}
else
{
// Single value
double
*
u
=
reinterpret_cast
<
double
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toDouble
();
}
break
;
}
}
// Send message
protocol
->
sendMessage
(
msg
);
}
else
{
result
=
false
;
}
return
result
;
}
QGCMAVLinkMessageSender
::~
QGCMAVLinkMessageSender
()
{
delete
ui
;
}
void
QGCMAVLinkMessageSender
::
createTreeView
()
{
for
(
int
i
=
0
;
i
<
256
;
++
i
)
//mavlink_message_t msg, receivedMessages)
{
// Update the tree view
QString
messageName
(
"%1 (%2 Hz, #%3)"
);
float
msgHz
=
messagesHz
.
value
(
i
,
0
);
// Ignore non-existent messages
if
(
QString
(
messageInfo
[
i
].
name
)
==
"EMPTY"
)
continue
;
messageName
=
messageName
.
arg
(
messageInfo
[
i
].
name
).
arg
(
msgHz
,
3
,
'f'
,
1
).
arg
(
i
);
if
(
!
treeWidgetItems
.
contains
(
i
))
{
QStringList
fields
;
fields
<<
messageName
;
QTreeWidgetItem
*
widget
=
new
QTreeWidgetItem
(
fields
);
widget
->
setFirstColumnSpanned
(
true
);
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
i
].
num_fields
;
++
j
)
{
QTreeWidgetItem
*
field
=
new
QTreeWidgetItem
();
widget
->
addChild
(
field
);
}
treeWidgetItems
.
insert
(
i
,
widget
);
ui
->
treeWidget
->
addTopLevelItem
(
widget
);
QTreeWidgetItem
*
message
=
widget
;
//treeWidgetItems.value(msg->msgid);
message
->
setFirstColumnSpanned
(
true
);
message
->
setData
(
0
,
Qt
::
DisplayRole
,
QVariant
(
messageName
));
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
i
].
num_fields
;
++
j
)
{
createField
(
i
,
j
,
message
->
child
(
j
));
}
// Add management fields, such as update rate and send button
// QTreeWidgetItem* management = new QTreeWidgetItem();
// widget->addChild(management);
// management->setData(0, Qt::DisplayRole, "Rate:");
// management->setData(1, Qt::DisplayRole, 0);
// management->setData(2, Qt::DisplayRole, "Hz");
// managementItems.insert(i, management);
}
}
}
void
QGCMAVLinkMessageSender
::
createField
(
int
msgid
,
int
fieldid
,
QTreeWidgetItem
*
item
)
{
// Add field tree widget item
item
->
setData
(
0
,
Qt
::
DisplayRole
,
QVariant
(
messageInfo
[
msgid
].
fields
[
fieldid
].
name
));
//uint8_t* m = ((uint8_t*)(receivedMessages+msgid))+8;
switch
(
messageInfo
[
msgid
].
fields
[
fieldid
].
type
)
{
case
MAVLINK_TYPE_CHAR
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"char"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
""
);
}
else
{
// Single char
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"char[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
""
);
}
break
;
case
MAVLINK_TYPE_UINT8_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"uint8_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"uint8_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0
);
}
break
;
case
MAVLINK_TYPE_INT8_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"int8_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"int8_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0
);
}
break
;
case
MAVLINK_TYPE_UINT16_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"uint16_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"uint16_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0
);
}
break
;
case
MAVLINK_TYPE_INT16_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"int16_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"int16_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0
);
}
break
;
case
MAVLINK_TYPE_UINT32_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"uint32_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"uint32_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0
);
}
break
;
case
MAVLINK_TYPE_INT32_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"int32_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"int32_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0
);
}
break
;
case
MAVLINK_TYPE_FLOAT
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0.0
f
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"float[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"float"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0.0
f
);
}
break
;
case
MAVLINK_TYPE_DOUBLE
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"double[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"double"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
0.0
);
}
break
;
case
MAVLINK_TYPE_UINT64_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"uint64_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"uint64_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
(
quint64
)
0
);
}
break
;
case
MAVLINK_TYPE_INT64_T
:
if
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
>
0
)
{
// Enforce null termination
QString
tmp
(
"%1, "
);
QString
string
;
for
(
unsigned
int
j
=
0
;
j
<
messageInfo
[
msgid
].
fields
[
j
].
array_length
;
++
j
)
{
string
+=
tmp
.
arg
(
0
);
}
item
->
setData
(
2
,
Qt
::
DisplayRole
,
QString
(
"int64_t[%1]"
).
arg
(
messageInfo
[
msgid
].
fields
[
fieldid
].
array_length
));
item
->
setData
(
1
,
Qt
::
DisplayRole
,
string
);
}
else
{
// Single value
item
->
setData
(
2
,
Qt
::
DisplayRole
,
"int64_t"
);
item
->
setData
(
1
,
Qt
::
DisplayRole
,
(
qint64
)
0
);
}
break
;
}
}
src/ui/mavlink/QGCMAVLinkMessageSender.h
deleted
100644 → 0
View file @
13a187b8
#ifndef QGCMAVLINKMESSAGESENDER_H
#define QGCMAVLINKMESSAGESENDER_H
#include <QWidget>
#include <QTreeWidgetItem>
#include <QMap>
#include <QTimer>
#include "MAVLinkProtocol.h"
namespace
Ui
{
class
QGCMAVLinkMessageSender
;
}
class
QGCMAVLinkMessageSender
:
public
QWidget
{
Q_OBJECT
friend
class
QTimer
;
public:
explicit
QGCMAVLinkMessageSender
(
MAVLinkProtocol
*
mavlink
,
QWidget
*
parent
=
0
);
~
QGCMAVLinkMessageSender
();
public
slots
:
/** @brief Send message currently selected in ui, taking values from tree view */
bool
sendMessage
();
protected:
mavlink_message_info_t
messageInfo
[
256
];
///< Meta information about all messages
MAVLinkProtocol
*
protocol
;
///< MAVLink protocol
QMap
<
int
,
float
>
messagesHz
;
///< Used to store update rate in Hz
QTimer
refreshTimer
;
QMap
<
unsigned
int
,
QTimer
*>
sendTimers
;
QMap
<
unsigned
int
,
QTreeWidgetItem
*>
managementItems
;
QMap
<
unsigned
int
,
QTreeWidgetItem
*>
treeWidgetItems
;
///< Messages
/** @brief Create the tree view of all messages */
void
createTreeView
();
/** @brief Create one field of one message in the tree view of all messages */
void
createField
(
int
msgid
,
int
fieldid
,
QTreeWidgetItem
*
item
);
/** @brief Send message with values taken from tree view */
bool
sendMessage
(
unsigned
int
id
);
protected
slots
:
/** @brief Read / display values in UI */
void
refresh
();
private:
Ui
::
QGCMAVLinkMessageSender
*
ui
;
};
#endif // QGCMAVLINKMESSAGESENDER_H
src/ui/mavlink/QGCMAVLinkMessageSender.ui
deleted
100644 → 0
View file @
13a187b8
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
QGCMAVLinkMessageSender
</class>
<widget
class=
"QWidget"
name=
"QGCMAVLinkMessageSender"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
300
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<property
name=
"margin"
>
<number>
6
</number>
</property>
<item
row=
"0"
column=
"0"
colspan=
"2"
>
<widget
class=
"QTreeWidget"
name=
"treeWidget"
>
<column>
<property
name=
"text"
>
<string
notr=
"true"
>
1
</string>
</property>
</column>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QSpinBox"
name=
"messageIdSpinBox"
/>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"sendButton"
>
<property
name=
"text"
>
<string>
Send Message
</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
src/ui/toolbar/MainToolBar.cc
View file @
696643ab
...
...
@@ -38,6 +38,7 @@ This file is part of the QGROUNDCONTROL project
#include "FlightDisplayView.h"
#include "QGCApplication.h"
#include "MultiVehicleManager.h"
#include "UAS.h"
MainToolBar
::
MainToolBar
(
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
parent
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment