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
28fc38f6
Commit
28fc38f6
authored
Oct 13, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dock Widgets only support floating
This is in preparation for full Qml main window
parent
2ba8a0f3
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
240 additions
and
204 deletions
+240
-204
QGCApplication.pro
QGCApplication.pro
+2
-2
FlightDisplayView.cc
src/FlightDisplay/FlightDisplayView.cc
+1
-1
FlightDisplayWidget.cc
src/FlightDisplay/FlightDisplayWidget.cc
+4
-2
FlightDisplayWidget.h
src/FlightDisplay/FlightDisplayWidget.h
+1
-1
MissionEditor.cc
src/MissionEditor/MissionEditor.cc
+1
-1
QGCDockWidget.cc
src/QGCDockWidget.cc
+40
-13
QGCDockWidget.h
src/QGCDockWidget.h
+10
-9
QGCQmlWidgetHolder.cpp
src/QGCQmlWidgetHolder.cpp
+6
-2
QGCQmlWidgetHolder.h
src/QGCQmlWidgetHolder.h
+8
-4
QmlTestWidget.cc
src/QmlControls/QmlTestWidget.cc
+1
-0
ScreenToolsController.cc
src/QmlControls/ScreenToolsController.cc
+1
-1
SetupView.cc
src/VehicleSetup/SetupView.cc
+1
-1
CustomCommandWidget.cc
src/ViewWidgets/CustomCommandWidget.cc
+6
-2
CustomCommandWidget.h
src/ViewWidgets/CustomCommandWidget.h
+1
-1
PX4RCCalibrationTest.cc
src/qgcunittest/PX4RCCalibrationTest.cc
+1
-1
HILDockWidget.cc
src/ui/HILDockWidget.cc
+4
-2
HILDockWidget.h
src/ui/HILDockWidget.h
+1
-1
MainWindow.cc
src/ui/MainWindow.cc
+94
-121
MainWindow.h
src/ui/MainWindow.h
+13
-9
MultiVehicleDockWidget.cc
src/ui/MultiVehicleDockWidget.cc
+4
-2
MultiVehicleDockWidget.h
src/ui/MultiVehicleDockWidget.h
+3
-3
QGCHilConfiguration.ui
src/ui/QGCHilConfiguration.ui
+1
-1
QGCMAVLinkInspector.cc
src/ui/QGCMAVLinkInspector.cc
+4
-2
QGCMAVLinkInspector.h
src/ui/QGCMAVLinkInspector.h
+3
-3
QGCMAVLinkInspector.ui
src/ui/QGCMAVLinkInspector.ui
+1
-1
QGCTabbedInfoView.cpp
src/ui/QGCTabbedInfoView.cpp
+4
-1
QGCTabbedInfoView.h
src/ui/QGCTabbedInfoView.h
+6
-4
QGCTabbedInfoView.ui
src/ui/QGCTabbedInfoView.ui
+1
-1
QGCUASFileViewMulti.cc
src/ui/QGCUASFileViewMulti.cc
+4
-2
QGCUASFileViewMulti.h
src/ui/QGCUASFileViewMulti.h
+3
-3
QGCUASFileViewMulti.ui
src/ui/QGCUASFileViewMulti.ui
+1
-1
UASInfo.ui
src/ui/UASInfo.ui
+1
-1
MainToolBar.cc
src/ui/toolbar/MainToolBar.cc
+1
-1
UASInfoWidget.cc
src/ui/uas/UASInfoWidget.cc
+4
-1
UASInfoWidget.h
src/ui/uas/UASInfoWidget.h
+3
-3
No files found.
QGCApplication.pro
View file @
28fc38f6
...
...
@@ -230,6 +230,7 @@ HEADERS += \
src
/
QGCApplication
.
h
\
src
/
QGCComboBox
.
h
\
src
/
QGCConfig
.
h
\
src
/
QGCDockWidget
.
h
\
src
/
QGCFileDialog
.
h
\
src
/
QGCGeo
.
h
\
src
/
QGCLoggingCategory
.
h
\
...
...
@@ -289,7 +290,6 @@ 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
\
...
...
@@ -340,6 +340,7 @@ SOURCES += \
src
/
QGC
.
cc
\
src
/
QGCApplication
.
cc
\
src
/
QGCComboBox
.
cc
\
src
/
QGCDockWidget
.
cc
\
src
/
QGCFileDialog
.
cc
\
src
/
QGCLoggingCategory
.
cc
\
src
/
QGCPalette
.
cc
\
...
...
@@ -393,7 +394,6 @@ 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/FlightDisplay/FlightDisplayView.cc
View file @
28fc38f6
...
...
@@ -35,7 +35,7 @@ This file is part of the QGROUNDCONTROL project
const
char
*
kMainFlightDisplayViewGroup
=
"FlightDisplayView"
;
FlightDisplayView
::
FlightDisplayView
(
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
parent
)
:
QGCQmlWidgetHolder
(
QString
(),
NULL
,
parent
)
{
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
MinimumExpanding
);
setObjectName
(
"FlightDisplayView"
);
...
...
src/FlightDisplay/FlightDisplayWidget.cc
View file @
28fc38f6
...
...
@@ -34,8 +34,8 @@ This file is part of the QGROUNDCONTROL project
const
char
*
kMainFlightDisplayWidgetGroup
=
"FlightDisplayWidget"
;
FlightDisplayWidget
::
FlightDisplayWidget
(
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
parent
)
FlightDisplayWidget
::
FlightDisplayWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
title
,
action
,
parent
)
{
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
MinimumExpanding
);
setObjectName
(
"FlightDisplayWidget"
);
...
...
@@ -86,6 +86,8 @@ FlightDisplayWidget::FlightDisplayWidget(QWidget *parent)
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/FlightDisplayWidget.qml"
));
setVisible
(
true
);
loadSettings
();
}
FlightDisplayWidget
::~
FlightDisplayWidget
()
...
...
src/FlightDisplay/FlightDisplayWidget.h
View file @
28fc38f6
...
...
@@ -30,7 +30,7 @@ class FlightDisplayWidget : public QGCQmlWidgetHolder
{
Q_OBJECT
public:
FlightDisplayWidget
(
QWidget
*
parent
=
NULL
);
FlightDisplayWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
NULL
);
~
FlightDisplayWidget
();
/// @brief Invokes the Flight Display Options menu
...
...
src/MissionEditor/MissionEditor.cc
View file @
28fc38f6
...
...
@@ -35,7 +35,7 @@ This file is part of the QGROUNDCONTROL project
const
char
*
MissionEditor
::
_settingsGroup
=
"MissionEditor"
;
MissionEditor
::
MissionEditor
(
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
parent
)
:
QGCQmlWidgetHolder
(
QString
(),
NULL
,
parent
)
,
_missionItems
(
NULL
)
,
_canEdit
(
true
)
{
...
...
src/QGCDockWidget.cc
View file @
28fc38f6
...
...
@@ -24,24 +24,51 @@
#include "QGCDockWidget.h"
#include <QCloseEvent>
#include <QSettings>
QGCDockWidget
::
QGCDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QDockWidget
(
title
,
parent
,
flags
),
_action
(
action
)
const
char
*
QGCDockWidget
::
_settingsGroup
=
"DockWidgets"
;
QGCDockWidget
::
QGCDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
QWidget
(
parent
)
,
_title
(
title
)
,
_action
(
action
)
{
QDockWidget
::
DockWidgetFeatures
features
=
QDockWidget
::
DockWidgetMovable
;
if
(
action
)
{
features
|=
QDockWidget
::
DockWidgetClosable
;
}
setFeatures
(
features
);
if
(
action
)
{
setWindowTitle
(
title
);
setWindowFlags
(
Qt
::
Tool
);
loadSettings
();
}
}
// Instead of destroying the widget just hide it
void
QGCDockWidget
::
closeEvent
(
QCloseEvent
*
event
)
{
Q_ASSERT
(
_action
);
event
->
ignore
();
_action
->
trigger
();
if
(
_action
)
{
saveSettings
();
event
->
ignore
();
_action
->
trigger
();
}
}
void
QGCDockWidget
::
loadSettings
(
void
)
{
if
(
_action
)
{
QSettings
settings
;
settings
.
beginGroup
(
_settingsGroup
);
if
(
settings
.
contains
(
_title
))
{
restoreGeometry
(
settings
.
value
(
_title
).
toByteArray
());
}
}
}
void
QGCDockWidget
::
saveSettings
(
void
)
{
if
(
_action
)
{
QSettings
settings
;
settings
.
beginGroup
(
_settingsGroup
);
settings
.
setValue
(
_title
,
saveGeometry
());
}
}
src/QGCDockWidget.h
View file @
28fc38f6
...
...
@@ -27,21 +27,22 @@
#include <QDockWidget>
#include <QAction>
/// @file
/// @brief Subclass of QDockWidget so we can intercept the closeEvent.
///
/// @author Don Gagne <don@thegagnes.com>
class
QGCDockWidget
:
public
QDockWidget
{
class
QGCDockWidget
:
public
QWidget
{
Q_OBJECT
public:
QGCDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
0
);
/// Pass in title = QString() and action = NULL when just using as a regular widget
QGCDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
void
loadSettings
(
void
);
void
saveSettings
(
void
);
void
closeEvent
(
QCloseEvent
*
event
);
private:
QAction
*
_action
;
protected:
QString
_title
;
QAction
*
_action
;
static
const
char
*
_settingsGroup
;
};
...
...
src/QGCQmlWidgetHolder.cpp
View file @
28fc38f6
...
...
@@ -26,10 +26,14 @@
#include "QGCQmlWidgetHolder.h"
QGCQmlWidgetHolder
::
QGCQmlWidgetHolder
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
QGCQmlWidgetHolder
::
QGCQmlWidgetHolder
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
Q
GCDockWidget
(
title
,
action
,
parent
)
{
_ui
.
setupUi
(
this
);
if
(
action
)
{
setWindowTitle
(
title
);
}
setResizeMode
(
QQuickWidget
::
SizeRootObjectToView
);
}
...
...
src/QGCQmlWidgetHolder.h
View file @
28fc38f6
...
...
@@ -27,10 +27,10 @@
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include <QWidget>
#include "QGCDockWidget.h"
#include "AutoPilotPlugin.h"
#include "ui_QGCQmlWidgetHolder.h"
#include "AutoPilotPlugin.h"
namespace
Ui
{
class
QGCQmlWidgetHolder
;
...
...
@@ -38,12 +38,16 @@ class QGCQmlWidgetHolder;
/// This is used to create widgets which are implemented in QML.
class
QGCQmlWidgetHolder
:
public
QWidget
class
QGCQmlWidgetHolder
:
public
Q
GCDock
Widget
{
Q_OBJECT
public:
explicit
QGCQmlWidgetHolder
(
QWidget
*
parent
=
0
);
// This has a title and action since the base class is QGCDockWidget. In order to use this
// control as a normal QWidget, not a doc widget just pass in:
// title = QString()
// action = NULL
explicit
QGCQmlWidgetHolder
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
~
QGCQmlWidgetHolder
();
/// Sets the UAS into the widget which in turn will load facts into the context
...
...
src/QmlControls/QmlTestWidget.cc
View file @
28fc38f6
...
...
@@ -27,6 +27,7 @@
#include "QmlTestWidget.h"
QmlTestWidget
::
QmlTestWidget
(
void
)
:
QGCQmlWidgetHolder
(
QString
(),
NULL
,
NULL
)
{
setAttribute
(
Qt
::
WA_DeleteOnClose
);
resize
(
900
,
500
);
...
...
src/QmlControls/ScreenToolsController.cc
View file @
28fc38f6
...
...
@@ -55,7 +55,7 @@ void ScreenToolsController::_updateCanvas()
double
ScreenToolsController
::
getQmlDefaultFontPixelSize
(
void
)
{
if
(
_qmlDefaultFontPixelSize
==
-
1
)
{
QGCQmlWidgetHolder
qmlWidgetHolder
;
QGCQmlWidgetHolder
qmlWidgetHolder
(
QString
(),
NULL
)
;
qmlWidgetHolder
.
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/ScreenToolsFontQuery.qml"
));
}
...
...
src/VehicleSetup/SetupView.cc
View file @
28fc38f6
...
...
@@ -41,7 +41,7 @@
#include <QDebug>
SetupView
::
SetupView
(
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
parent
)
QGCQmlWidgetHolder
(
QString
(),
NULL
,
parent
)
{
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/SetupView.qml"
));
}
...
...
src/ViewWidgets/CustomCommandWidget.cc
View file @
28fc38f6
...
...
@@ -23,8 +23,12 @@ This file is part of the QGROUNDCONTROL project
#include "CustomCommandWidget.h"
CustomCommandWidget
::
CustomCommandWidget
(
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
parent
)
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
View file @
28fc38f6
...
...
@@ -34,7 +34,7 @@ class CustomCommandWidget : public QGCQmlWidgetHolder
Q_OBJECT
public:
CustomCommandWidget
(
QWidget
*
parent
=
0
);
CustomCommandWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
};
#endif
src/qgcunittest/PX4RCCalibrationTest.cc
View file @
28fc38f6
...
...
@@ -164,7 +164,7 @@ void RadioConfigTest::init(void)
Q_ASSERT
(
_autopilot
);
// This will instatiate the widget with an active uas with ready parameters
_calWidget
=
new
QGCQmlWidgetHolder
();
_calWidget
=
new
QGCQmlWidgetHolder
(
QString
(),
NULL
);
_calWidget
->
resize
(
600
,
600
);
Q_CHECK_PTR
(
_calWidget
);
_calWidget
->
setAutoPilot
(
_autopilot
);
...
...
src/ui/HILDockWidget.cc
View file @
28fc38f6
...
...
@@ -24,10 +24,12 @@
#include "HILDockWidget.h"
#include "QGCHilConfiguration.h"
HILDockWidget
::
HILDockWidget
(
QWidget
*
parent
)
:
MultiVehicleDockWidget
(
parent
)
HILDockWidget
::
HILDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
MultiVehicleDockWidget
(
title
,
action
,
parent
)
{
init
();
loadSettings
();
}
HILDockWidget
::~
HILDockWidget
()
...
...
src/ui/HILDockWidget.h
View file @
28fc38f6
...
...
@@ -31,7 +31,7 @@ class HILDockWidget : public MultiVehicleDockWidget
Q_OBJECT
public:
explicit
HILDockWidget
(
QWidget
*
parent
=
0
);
explicit
HILDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
~
HILDockWidget
();
protected:
...
...
src/ui/MainWindow.cc
View file @
28fc38f6
...
...
@@ -88,14 +88,15 @@ This file is part of the QGROUNDCONTROL project
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"
;
const
char
*
MainWindow
::
_uasStatusDetailsDockWidgetName
=
"UAS_STATUS_DETAILS_DOCKWIDGET"
;
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"
;
const
char
*
MainWindow
::
_mavlinkDockWidgetName
=
"MAVLink Inspector"
;
const
char
*
MainWindow
::
_customCommandWidgetName
=
"Custom Command"
;
const
char
*
MainWindow
::
_filesDockWidgetName
=
"Onboard Files"
;
const
char
*
MainWindow
::
_uasStatusDetailsDockWidgetName
=
"Status Details"
;
const
char
*
MainWindow
::
_pfdDockWidgetName
=
"Primary Flight Display"
;
const
char
*
MainWindow
::
_uasInfoViewDockWidgetName
=
"Info View"
;
const
char
*
MainWindow
::
_hilDockWidgetName
=
"HIL Config"
;
const
char
*
MainWindow
::
_visibleWidgetsKey
=
"VisibleWidgets"
;
#endif
static
MainWindow
*
_instance
=
NULL
;
///< @brief MainWindow singleton
...
...
@@ -313,6 +314,10 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
qd
.
close
();
#endif
}
#ifndef __mobile__
_loadVisibleWidgetsSettings
();
#endif
}
MainWindow
::~
MainWindow
()
...
...
@@ -341,34 +346,6 @@ QString MainWindow::_getWindowGeometryKey()
}
#ifndef __mobile__
void
MainWindow
::
_createDockWidget
(
const
QString
&
title
,
const
QString
&
name
,
Qt
::
DockWidgetArea
area
,
QWidget
*
innerWidget
)
{
Q_ASSERT
(
!
_mapName2DockWidget
.
contains
(
name
));
// Add to menu
QAction
*
action
=
new
QAction
(
title
,
NULL
);
action
->
setCheckable
(
true
);
action
->
setData
(
name
);
connect
(
action
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
_showDockWidgetAction
);
_ui
.
menuWidgets
->
addAction
(
action
);
// Create widget
QGCDockWidget
*
dockWidget
=
new
QGCDockWidget
(
title
,
action
,
this
);
Q_CHECK_PTR
(
dockWidget
);
dockWidget
->
setObjectName
(
name
);
dockWidget
->
setVisible
(
false
);
if
(
innerWidget
)
{
// Put inner widget inside QDockWidget
innerWidget
->
setParent
(
dockWidget
);
dockWidget
->
setWidget
(
innerWidget
);
innerWidget
->
setVisible
(
true
);
}
_mapName2DockWidget
[
name
]
=
dockWidget
;
_mapDockWidget2Action
[
dockWidget
]
=
action
;
addDockWidget
(
area
,
dockWidget
);
}
void
MainWindow
::
_buildCommonWidgets
(
void
)
{
// Add generic MAVLink decoder
...
...
@@ -382,99 +359,80 @@ void MainWindow::_buildCommonWidgets(void)
logPlayer
=
new
QGCMAVLinkLogPlayer
(
statusBar
());
statusBar
()
->
addPermanentWidget
(
logPlayer
);
// In order for Qt to save and restore state of widgets all widgets must be created ahead of time. We only create the QDockWidget
// holders. We do not create the actual inner widget until it is needed. This saves memory and cpu from running widgets that are
// never shown.
struct
DockWidgetInfo
{
const
char
*
name
;
const
char
*
title
;
Qt
::
DockWidgetArea
area
;
};
static
const
struct
DockWidgetInfo
rgDockWidgetInfo
[]
=
{
{
_mavlinkDockWidgetName
,
"MAVLink Inspector"
,
Qt
::
RightDockWidgetArea
},
{
_customCommandWidgetName
,
"Custom Command"
,
Qt
::
RightDockWidgetArea
},
{
_filesDockWidgetName
,
"Onboard Files"
,
Qt
::
RightDockWidgetArea
},
{
_uasStatusDetailsDockWidgetName
,
"Status Details"
,
Qt
::
RightDockWidgetArea
},
{
_mapViewDockWidgetName
,
"Map view"
,
Qt
::
RightDockWidgetArea
},
{
_pfdDockWidgetName
,
"Primary Flight Display"
,
Qt
::
RightDockWidgetArea
},
{
_uasInfoViewDockWidgetName
,
"Info View"
,
Qt
::
LeftDockWidgetArea
},
{
_hilDockWidgetName
,
"HIL Config"
,
Qt
::
LeftDockWidgetArea
},
static
const
char
*
rgDockWidgetNames
[]
=
{
_mavlinkDockWidgetName
,
_customCommandWidgetName
,
_filesDockWidgetName
,
_uasStatusDetailsDockWidgetName
,
_pfdDockWidgetName
,
_uasInfoViewDockWidgetName
,
_hilDockWidgetName
,
};
static
const
size_t
cDockWidget
Info
=
sizeof
(
rgDockWidgetInfo
)
/
sizeof
(
rgDockWidgetInfo
[
0
]);
static
const
size_t
cDockWidget
Names
=
sizeof
(
rgDockWidgetNames
)
/
sizeof
(
rgDockWidgetNames
[
0
]);
for
(
size_t
i
=
0
;
i
<
cDockWidgetInfo
;
i
++
)
{
const
struct
DockWidgetInfo
*
pDockInfo
=
&
rgDockWidgetInfo
[
i
];
_createDockWidget
(
pDockInfo
->
title
,
pDockInfo
->
name
,
pDockInfo
->
area
,
NULL
/* no inner widget yet */
);
for
(
size_t
i
=
0
;
i
<
cDockWidgetNames
;
i
++
)
{
const
char
*
pDockWidgetName
=
rgDockWidgetNames
[
i
];
// Add to menu
QAction
*
action
=
new
QAction
(
pDockWidgetName
,
NULL
);
action
->
setCheckable
(
true
);
action
->
setData
(
pDockWidgetName
);
connect
(
action
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
_showDockWidgetAction
);
_ui
.
menuWidgets
->
addAction
(
action
);
_mapName2Action
[
pDockWidgetName
]
=
action
;
}
}
/// Shows or hides the specified dock widget, creating if necessary
void
MainWindow
::
_showDockWidget
(
const
QString
&
name
,
bool
show
)
{
if
(
!
_mapName2DockWidget
.
contains
(
name
))
{
// Don't show any sort of warning here. Dock Widgets which have been remove could still be in settings.
// Which would cause us to end up here.
return
;
}
// Create the inner widget if we need to
if
(
!
_mapName2DockWidget
[
name
]
->
widget
(
))
{
if
(
!
_mapName2DockWidget
.
contains
(
name
))
{
_createInnerDockWidget
(
name
);
}
Q_ASSERT
(
_mapName2DockWidget
.
contains
(
name
));
QDockWidget
*
dockWidget
=
_mapName2DockWidget
[
name
];
Q
GC
DockWidget
*
dockWidget
=
_mapName2DockWidget
[
name
];
Q_ASSERT
(
dockWidget
);
dockWidget
->
setVisible
(
show
);
Q_ASSERT
(
_map
DockWidget2Action
.
contains
(
dockWidget
));
_map
DockWidget2Action
[
dockWidget
]
->
setChecked
(
show
);
Q_ASSERT
(
_map
Name2Action
.
contains
(
name
));
_map
Name2Action
[
name
]
->
setChecked
(
show
);
}
/// Creates the specified inner dock widget and adds to the QDockWidget
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
;
QGCDockWidget
*
widget
=
NULL
;
if
(
widgetName
==
_mavlinkDockWidgetName
)
{
widget
=
new
QGCMAVLinkInspector
(
MAVLinkProtocol
::
instance
(),
this
);
widget
=
new
QGCMAVLinkInspector
(
widgetName
,
_mapName2Action
[
widgetName
],
MAVLinkProtocol
::
instance
(),
this
);
}
else
if
(
widgetName
==
_customCommandWidgetName
)
{
widget
=
new
CustomCommandWidget
(
this
);
widget
=
new
CustomCommandWidget
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
}
else
if
(
widgetName
==
_filesDockWidgetName
)
{
widget
=
new
QGCUASFileViewMulti
(
this
);
widget
=
new
QGCUASFileViewMulti
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
}
else
if
(
widgetName
==
_uasStatusDetailsDockWidgetName
)
{
widget
=
new
UASInfoWidget
(
this
);
widget
=
new
UASInfoWidget
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
}
else
if
(
widgetName
==
_pfdDockWidgetName
)
{
widget
=
new
FlightDisplayWidget
(
this
);
#ifndef __mobile__
widget
=
new
FlightDisplayWidget
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
}
else
if
(
widgetName
==
_hilDockWidgetName
)
{
widget
=
new
HILDockWidget
(
this
);
#endif
widget
=
new
HILDockWidget
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
}
else
if
(
widgetName
==
_uasInfoViewDockWidgetName
)
{
QGCTabbedInfoView
*
pInfoView
=
new
QGCTabbedInfoView
(
this
);
QGCTabbedInfoView
*
pInfoView
=
new
QGCTabbedInfoView
(
widgetName
,
_mapName2Action
[
widgetName
],
this
);
pInfoView
->
addSource
(
mavlinkDecoder
);
widget
=
pInfoView
;
}
else
{
qWarning
()
<<
"Attempt to create unknown Inner Dock Widget"
<<
widgetName
;
}
if
(
widget
)
{
QDockWidget
*
dockWidget
=
_mapName2DockWidget
[
widgetName
];
Q_CHECK_PTR
(
dockWidget
);
widget
->
setParent
(
dockWidget
);
dockWidget
->
setWidget
(
widget
);
}
_mapName2DockWidget
[
widgetName
]
=
widget
;
}
void
MainWindow
::
_hideAllDockWidgets
(
void
)
{
foreach
(
QDockWidget
*
dockWidget
,
_mapName2DockWidget
)
{
foreach
(
Q
GC
DockWidget
*
dockWidget
,
_mapName2DockWidget
)
{
dockWidget
->
setVisible
(
false
);
}
}
...
...
@@ -483,7 +441,7 @@ void MainWindow::_showDockWidgetAction(bool show)
{
QAction
*
action
=
dynamic_cast
<
QAction
*>
(
QObject
::
sender
());
Q_ASSERT
(
action
);
_showDockWidget
(
action
->
data
().
toString
(),
show
);
_showDockWidget
(
action
->
text
(),
show
);
}
#endif
...
...
@@ -592,6 +550,10 @@ void MainWindow::storeSettings()
// Save the last current view in any case
settings
.
setValue
(
"CURRENT_VIEW"
,
_currentView
);
settings
.
setValue
(
_getWindowStateKey
(),
saveState
());
#ifndef __mobile__
_storeVisibleWidgetsSettings
();
#endif
}
void
MainWindow
::
configureWindowName
()
...
...
@@ -751,20 +713,11 @@ void MainWindow::_vehicleAdded(Vehicle* vehicle)
void
MainWindow
::
_storeCurrentViewState
(
void
)
{
#ifndef __mobile__
// Save list of visible widgets
bool
firstWidget
=
true
;
QString
widgetNames
=
""
;
foreach
(
QDockWidget
*
dockWidget
,
_mapName2DockWidget
)
{
if
(
dockWidget
->
isVisible
())
{
if
(
!
firstWidget
)
{
widgetNames
+=
","
;
}
widgetNames
+=
dockWidget
->
objectName
();
firstWidget
=
false
;
}
foreach
(
QGCDockWidget
*
dockWidget
,
_mapName2DockWidget
)
{
dockWidget
->
saveSettings
();
}
settings
.
setValue
(
_getWindowStateKey
()
+
"WIDGETS"
,
widgetNames
);
#endif
settings
.
setValue
(
_getWindowStateKey
(),
saveState
());
settings
.
setValue
(
_getWindowGeometryKey
(),
saveGeometry
());
}
...
...
@@ -773,7 +726,6 @@ void MainWindow::_storeCurrentViewState(void)
void
MainWindow
::
_loadCurrentViewState
(
void
)
{
QWidget
*
centerView
=
NULL
;
QString
defaultWidgets
;
switch
(
_currentView
)
{
case
VIEW_SETUP
:
...
...
@@ -784,13 +736,11 @@ void MainWindow::_loadCurrentViewState(void)
case
VIEW_ANALYZE
:
_buildAnalyzeView
();
centerView
=
_analyzeView
;
defaultWidgets
=
"PARAMETER_INTERFACE_DOCKWIDGET,FILE_VIEW_DOCKWIDGET"
;
break
;
case
VIEW_FLIGHT
:
_buildFlightView
();
centerView
=
_flightView
;
defaultWidgets
=
"COMMUNICATION_CONSOLE_DOCKWIDGET,UAS_INFO_INFOVIEW_DOCKWIDGET"
;
break
;
case
VIEW_MISSIONEDITOR
:
...
...
@@ -820,22 +770,6 @@ void MainWindow::_loadCurrentViewState(void)
_centralLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
_currentViewWidget
->
setVisible
(
true
);
#ifndef __mobile__
// Hide all widgets from previous view
_hideAllDockWidgets
();
// Restore the widgets for the new view
QString
widgetNames
=
settings
.
value
(
_getWindowStateKey
()
+
"WIDGETS"
,
defaultWidgets
).
toString
();
qDebug
()
<<
widgetNames
;
if
(
!
widgetNames
.
isEmpty
())
{
QStringList
split
=
widgetNames
.
split
(
","
);
foreach
(
QString
widgetName
,
split
)
{
Q_ASSERT
(
!
widgetName
.
isEmpty
());
_showDockWidget
(
widgetName
,
true
);
}
}
#endif
if
(
settings
.
contains
(
_getWindowStateKey
()))
{
restoreState
(
settings
.
value
(
_getWindowStateKey
()).
toByteArray
());
}
...
...
@@ -949,3 +883,42 @@ void MainWindow::_showQmlTestWidget(void)
new
QmlTestWidget
();
}
#endif
#ifndef __mobile__
void
MainWindow
::
_loadVisibleWidgetsSettings
(
void
)
{
QSettings
settings
;
QString
widgets
=
settings
.
value
(
_visibleWidgetsKey
).
toString
();
if
(
!
widgets
.
isEmpty
())
{
QStringList
nameList
=
widgets
.
split
(
","
);
foreach
(
QString
name
,
nameList
)
{
_showDockWidget
(
name
,
true
);
}
}
}
void
MainWindow
::
_storeVisibleWidgetsSettings
(
void
)
{
QString
widgetNames
;
bool
firstWidget
=
true
;
foreach
(
QString
name
,
_mapName2DockWidget
.
keys
())
{
if
(
_mapName2DockWidget
[
name
]
->
isVisible
())
{
if
(
!
firstWidget
)
{
widgetNames
+=
","
;
}
else
{
firstWidget
=
false
;
}
widgetNames
+=
name
;
}
}
QSettings
settings
;
settings
.
setValue
(
_visibleWidgetsKey
,
widgetNames
);
}
#endif
src/ui/MainWindow.h
View file @
28fc38f6
...
...
@@ -35,24 +35,26 @@ This file is part of the QGROUNDCONTROL project
#include <QStatusBar>
#include <QStackedWidget>
#include <QSettings>
#include <
qlist.h
>
#include <
QList
>
#include "ui_MainWindow.h"
#include "LinkManager.h"
#include "LinkInterface.h"
#include "UASInterface.h"
#include "CameraView.h"
#if (defined QGC_MOUSE_ENABLED_WIN) | (defined QGC_MOUSE_ENABLED_LINUX)
#include "Mouse6dofInput.h"
#endif // QGC_MOUSE_ENABLED_WIN
#include "MainToolBar.h"
#include "LogCompressor.h"
#include "FlightDisplayView.h"
#include "QGCMAVLinkInspector.h"
#include "QGCMAVLinkLogPlayer.h"
#include "MAVLinkDecoder.h"
#include "Vehicle.h"
#include "QGCDockWidget.h"
#if (defined QGC_MOUSE_ENABLED_WIN) | (defined QGC_MOUSE_ENABLED_LINUX)
#include "Mouse6dofInput.h"
#endif // QGC_MOUSE_ENABLED_WIN
class
QGCFirmwareUpdate
;
class
QSplashScreen
;
...
...
@@ -270,13 +272,12 @@ private:
static
const
char
*
_customCommandWidgetName
;
static
const
char
*
_filesDockWidgetName
;
static
const
char
*
_uasStatusDetailsDockWidgetName
;
static
const
char
*
_mapViewDockWidgetName
;
static
const
char
*
_pfdDockWidgetName
;
static
const
char
*
_uasInfoViewDockWidgetName
;
static
const
char
*
_hilDockWidgetName
;
QMap
<
QString
,
Q
DockWidget
*>
_mapName2DockWidget
;
QMap
<
Q
DockWidget
*
,
QAction
*>
_mapDockWidget
2Action
;
QMap
<
QString
,
Q
GCDockWidget
*>
_mapName2DockWidget
;
QMap
<
Q
String
,
QAction
*>
_mapName
2Action
;
#endif
void
_buildPlanView
(
void
);
...
...
@@ -290,11 +291,14 @@ private:
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
);
void
_loadVisibleWidgetsSettings
(
void
);
void
_storeVisibleWidgetsSettings
(
void
);
static
const
char
*
_visibleWidgetsKey
;
#endif
bool
_autoReconnect
;
...
...
src/ui/MultiVehicleDockWidget.cc
View file @
28fc38f6
...
...
@@ -25,12 +25,14 @@
#include "ui_MultiVehicleDockWidget.h"
#include "MultiVehicleManager.h"
MultiVehicleDockWidget
::
MultiVehicleDockWidget
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
MultiVehicleDockWidget
::
MultiVehicleDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
Q
GCDockWidget
(
title
,
action
,
parent
)
,
_ui
(
new
Ui
::
MultiVehicleDockWidget
)
{
_ui
->
setupUi
(
this
);
setWindowTitle
(
title
);
connect
(
MultiVehicleManager
::
instance
(),
&
MultiVehicleManager
::
activeVehicleChanged
,
this
,
&
MultiVehicleDockWidget
::
_activeVehicleChanged
);
connect
(
MultiVehicleManager
::
instance
(),
&
MultiVehicleManager
::
vehicleAdded
,
this
,
&
MultiVehicleDockWidget
::
_vehicleAdded
);
connect
(
MultiVehicleManager
::
instance
(),
&
MultiVehicleManager
::
vehicleRemoved
,
this
,
&
MultiVehicleDockWidget
::
_vehicleRemoved
);
...
...
src/ui/MultiVehicleDockWidget.h
View file @
28fc38f6
...
...
@@ -24,9 +24,9 @@
#ifndef MultiVehicleDockWidget_H
#define MultiVehicleDockWidget_H
#include <QWidget>
#include <QMap>
#include "QGCDockWidget.h"
#include "Vehicle.h"
namespace
Ui
...
...
@@ -37,12 +37,12 @@ namespace Ui
/// Provides a base class for a dock widget which automatically handles
/// Vehicles coming and going. It does this by using a stacked widget which
/// holds individual Vehicle specific widgets.
class
MultiVehicleDockWidget
:
public
QWidget
class
MultiVehicleDockWidget
:
public
Q
GCDock
Widget
{
Q_OBJECT
public:
explicit
MultiVehicleDockWidget
(
QWidget
*
parent
=
0
);
explicit
MultiVehicleDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
~
MultiVehicleDockWidget
();
/// Must be called in the derived class contructor to initialize the base class
...
...
src/ui/QGCHilConfiguration.ui
View file @
28fc38f6
...
...
@@ -17,7 +17,7 @@
</sizepolicy>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
<string>
HIL Config
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowstretch=
"1,100,1"
columnstretch=
"40,0"
>
<item
row=
"0"
column=
"0"
>
...
...
src/ui/QGCMAVLinkInspector.cc
View file @
28fc38f6
...
...
@@ -12,8 +12,8 @@
const
float
QGCMAVLinkInspector
::
updateHzLowpass
=
0.2
f
;
const
unsigned
int
QGCMAVLinkInspector
::
updateInterval
=
1000U
;
QGCMAVLinkInspector
::
QGCMAVLinkInspector
(
MAVLinkProtocol
*
protocol
,
QWidget
*
parent
)
:
Q
Widget
(
parent
),
QGCMAVLinkInspector
::
QGCMAVLinkInspector
(
const
QString
&
title
,
QAction
*
action
,
MAVLinkProtocol
*
protocol
,
QWidget
*
parent
)
:
Q
GCDockWidget
(
title
,
action
,
parent
),
_protocol
(
protocol
),
selectedSystemID
(
0
),
selectedComponentID
(
0
),
...
...
@@ -58,6 +58,8 @@ QGCMAVLinkInspector::QGCMAVLinkInspector(MAVLinkProtocol* protocol, QWidget *par
// Attach the UI's refresh rate to a timer.
connect
(
&
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
refreshView
()));
updateTimer
.
start
(
updateInterval
);
loadSettings
();
}
void
QGCMAVLinkInspector
::
_vehicleAdded
(
Vehicle
*
vehicle
)
...
...
src/ui/QGCMAVLinkInspector.h
View file @
28fc38f6
#ifndef QGCMAVLINKINSPECTOR_H
#define QGCMAVLINKINSPECTOR_H
#include <QWidget>
#include <QMap>
#include <QTimer>
#include "QGCDockWidget.h"
#include "MAVLinkProtocol.h"
#include "Vehicle.h"
...
...
@@ -15,12 +15,12 @@ namespace Ui {
class
QTreeWidgetItem
;
class
UASInterface
;
class
QGCMAVLinkInspector
:
public
QWidget
class
QGCMAVLinkInspector
:
public
Q
GCDock
Widget
{
Q_OBJECT
public:
explicit
QGCMAVLinkInspector
(
MAVLinkProtocol
*
protocol
,
QWidget
*
parent
=
0
);
explicit
QGCMAVLinkInspector
(
const
QString
&
title
,
QAction
*
action
,
MAVLinkProtocol
*
protocol
,
QWidget
*
parent
=
0
);
~
QGCMAVLinkInspector
();
public
slots
:
...
...
src/ui/QGCMAVLinkInspector.ui
View file @
28fc38f6
...
...
@@ -11,7 +11,7 @@
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
<string>
MAVLink Inspector
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
columnstretch=
"2,8,2,8,3"
>
<property
name=
"leftMargin"
>
...
...
src/ui/QGCTabbedInfoView.cpp
View file @
28fc38f6
#include "QGCTabbedInfoView.h"
QGCTabbedInfoView
::
QGCTabbedInfoView
(
QWidget
*
parent
)
:
QWidget
(
parent
)
QGCTabbedInfoView
::
QGCTabbedInfoView
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
QGCDockWidget
(
title
,
action
,
parent
)
{
ui
.
setupUi
(
this
);
messageView
=
new
UASMessageViewWidget
(
this
);
...
...
@@ -11,6 +12,8 @@ QGCTabbedInfoView::QGCTabbedInfoView(QWidget *parent) : QWidget(parent)
//ui.tabWidget->addTab(actionsWidget,"Actions");
//ui.tabWidget->addTab(rawView,"Status");
ui
.
tabWidget
->
addTab
(
messageView
,
"Messages"
);
loadSettings
();
}
void
QGCTabbedInfoView
::
addSource
(
MAVLinkDecoder
*
decoder
)
{
...
...
src/ui/QGCTabbedInfoView.h
View file @
28fc38f6
#ifndef QGCTABBEDINFOVIEW_H
#define QGCTABBEDINFOVIEW_H
#include <QWidget>
#include "ui_QGCTabbedInfoView.h"
#include "QGCDockWidget.h"
#include "MAVLinkDecoder.h"
#include "UASMessageView.h"
#include "UASQuickView.h"
#include "UASRawStatusView.h"
class
QGCTabbedInfoView
:
public
QWidget
#include "ui_QGCTabbedInfoView.h"
class
QGCTabbedInfoView
:
public
QGCDockWidget
{
Q_OBJECT
public:
explicit
QGCTabbedInfoView
(
QWidget
*
parent
=
0
);
explicit
QGCTabbedInfoView
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
~
QGCTabbedInfoView
();
void
addSource
(
MAVLinkDecoder
*
decoder
);
private:
...
...
src/ui/QGCTabbedInfoView.ui
View file @
28fc38f6
...
...
@@ -11,7 +11,7 @@
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
<string>
Info View
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
...
...
src/ui/QGCUASFileViewMulti.cc
View file @
28fc38f6
...
...
@@ -4,8 +4,8 @@
#include "MultiVehicleManager.h"
#include "QGCUASFileView.h"
QGCUASFileViewMulti
::
QGCUASFileViewMulti
(
QWidget
*
parent
)
:
Q
Widget
(
parent
),
QGCUASFileViewMulti
::
QGCUASFileViewMulti
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
)
:
Q
GCDockWidget
(
title
,
action
,
parent
),
ui
(
new
Ui
::
QGCUASFileViewMulti
)
{
ui
->
setupUi
(
this
);
...
...
@@ -18,6 +18,8 @@ QGCUASFileViewMulti::QGCUASFileViewMulti(QWidget *parent) :
_vehicleAdded
(
MultiVehicleManager
::
instance
()
->
activeVehicle
());
_activeVehicleChanged
(
MultiVehicleManager
::
instance
()
->
activeVehicle
());
}
loadSettings
();
}
void
QGCUASFileViewMulti
::
_vehicleRemoved
(
Vehicle
*
vehicle
)
...
...
src/ui/QGCUASFileViewMulti.h
View file @
28fc38f6
#ifndef QGCUASFILEVIEWMULTI_H
#define QGCUASFILEVIEWMULTI_H
#include <QWidget>
#include <QMap>
#include "QGCDockWidget.h"
#include "QGCUASFileView.h"
#include "UAS.h"
...
...
@@ -12,12 +12,12 @@ namespace Ui
class
QGCUASFileViewMulti
;
}
class
QGCUASFileViewMulti
:
public
QWidget
class
QGCUASFileViewMulti
:
public
Q
GCDock
Widget
{
Q_OBJECT
public:
explicit
QGCUASFileViewMulti
(
QWidget
*
parent
=
0
);
explicit
QGCUASFileViewMulti
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
);
~
QGCUASFileViewMulti
();
protected:
...
...
src/ui/QGCUASFileViewMulti.ui
View file @
28fc38f6
...
...
@@ -11,7 +11,7 @@
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
<string>
Onboard Files
</string>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<property
name=
"margin"
>
...
...
src/ui/UASInfo.ui
View file @
28fc38f6
...
...
@@ -11,7 +11,7 @@
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
<string>
Status Details
</string>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
/>
...
...
src/ui/toolbar/MainToolBar.cc
View file @
28fc38f6
...
...
@@ -41,7 +41,7 @@ This file is part of the QGROUNDCONTROL project
#include "UAS.h"
MainToolBar
::
MainToolBar
(
QWidget
*
parent
)
:
QGCQmlWidgetHolder
(
parent
)
:
QGCQmlWidgetHolder
(
QString
(),
NULL
,
parent
)
,
_vehicle
(
NULL
)
,
_mav
(
NULL
)
,
_toolBar
(
NULL
)
...
...
src/ui/uas/UASInfoWidget.cc
View file @
28fc38f6
...
...
@@ -43,7 +43,8 @@ This file is part of the PIXHAWK project
#include "QGC.h"
#include "UAS.h"
UASInfoWidget
::
UASInfoWidget
(
QWidget
*
parent
,
QString
name
)
:
QWidget
(
parent
)
UASInfoWidget
::
UASInfoWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
,
QString
name
)
:
QGCDockWidget
(
title
,
action
,
parent
)
{
ui
.
setupUi
(
this
);
this
->
name
=
name
;
...
...
@@ -72,6 +73,8 @@ UASInfoWidget::UASInfoWidget(QWidget *parent, QString name) : QWidget(parent)
updateTimer
->
start
(
updateInterval
);
this
->
setVisible
(
false
);
loadSettings
();
}
UASInfoWidget
::~
UASInfoWidget
()
...
...
src/ui/uas/UASInfoWidget.h
View file @
28fc38f6
...
...
@@ -32,10 +32,10 @@ This file is part of the QGROUNDCONTROL project
#ifndef _UASINFOWIDGET_H_
#define _UASINFOWIDGET_H_
#include <QWidget>
#include <QTimer>
#include <QMap>
#include "QGCDockWidget.h"
#include "UASInterface.h"
#include "ui_UASInfo.h"
#include "Vehicle.h"
...
...
@@ -44,11 +44,11 @@ This file is part of the QGROUNDCONTROL project
* @brief Info indicator for the currently active UAS
*
**/
class
UASInfoWidget
:
public
QWidget
class
UASInfoWidget
:
public
Q
GCDock
Widget
{
Q_OBJECT
public:
UASInfoWidget
(
QWidget
*
parent
=
0
,
QString
name
=
""
);
UASInfoWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
=
0
,
QString
name
=
""
);
~
UASInfoWidget
();
public
slots
:
...
...
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