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
27737cde
Commit
27737cde
authored
Dec 12, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added widget menu
parent
07b5f77e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
138 additions
and
19 deletions
+138
-19
qgroundcontrol.pri
qgroundcontrol.pri
+2
-0
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
MAVLinkSimulationLink.cc
src/comm/MAVLinkSimulationLink.cc
+8
-7
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+1
-1
MainWindow.cc
src/ui/MainWindow.cc
+55
-0
MainWindow.h
src/ui/MainWindow.h
+7
-0
QGCMainWindowAPConfigurator.cc
src/ui/QGCMainWindowAPConfigurator.cc
+6
-0
QGCMainWindowAPConfigurator.h
src/ui/QGCMainWindowAPConfigurator.h
+18
-0
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+31
-9
QGCGoogleEarthView.h
src/ui/map3D/QGCGoogleEarthView.h
+6
-0
No files found.
qgroundcontrol.pri
View file @
27737cde
...
...
@@ -80,6 +80,8 @@ macx {
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
# Copy google earth starter file
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
# Copy CSS stylesheet
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-mission.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/qgroundcontrol.css
# Copy model files
#QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
...
...
qgroundcontrol.pro
View file @
27737cde
...
...
@@ -249,7 +249,8 @@ HEADERS += src/MG.h \
src
/
ui
/
SlugsHilSim
.
h
\
src
/
ui
/
SlugsPIDControl
.
h
\
src
/
ui
/
SlugsVideoCamControl
.
h
\
src
/
ui
/
SlugsPadCameraControl
.
h
src
/
ui
/
SlugsPadCameraControl
.
h
\
src
/
ui
/
QGCMainWindowAPConfigurator
.
h
contains
(
DEPENDENCIES_PRESENT
,
osg
)
{
message
(
"Including headers for OpenSceneGraph"
)
...
...
@@ -359,7 +360,8 @@ SOURCES += src/main.cc \
src
/
ui
/
SlugsHilSim
.
cc
\
src
/
ui
/
SlugsPIDControl
.
cpp
\
src
/
ui
/
SlugsVideoCamControl
.
cpp
\
src
/
ui
/
SlugsPadCameraControl
.
cpp
src
/
ui
/
SlugsPadCameraControl
.
cpp
\
src
/
ui
/
QGCMainWindowAPConfigurator
.
cc
contains
(
DEPENDENCIES_PRESENT
,
osg
)
{
message
(
"Including sources for OpenSceneGraph"
)
...
...
src/comm/MAVLinkSimulationLink.cc
View file @
27737cde
...
...
@@ -559,16 +559,17 @@ void MAVLinkSimulationLink::mainloop()
// Send controller states
// uint8_t attControl = 1;
// uint8_t posXYControl = 1;
// uint8_t posZControl = 0;
// uint8_t posYawControl = 1;
// uint8_t gpsLock = 2;
// uint8_t visLock = 3;
//uint8_t posLock = qMax(gpsLock, visLock);
#ifdef MAVLINK_ENABLED_PIXHAWK
uint8_t
attControl
=
1
;
uint8_t
posXYControl
=
1
;
uint8_t
posZControl
=
0
;
uint8_t
posYawControl
=
1
;
uint8_t
gpsLock
=
2
;
uint8_t
visLock
=
3
;
uint8_t
posLock
=
qMax
(
gpsLock
,
visLock
);
messageSize
=
mavlink_msg_control_status_pack
(
systemId
,
componentId
,
&
msg
,
posLock
,
visLock
,
gpsLock
,
attControl
,
posXYControl
,
posZControl
,
posYawControl
);
#endif
...
...
src/uas/PxQuadMAV.cc
View file @
27737cde
...
...
@@ -41,12 +41,12 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
// Let UAS handle the default message set
UAS
::
receiveMessage
(
link
,
message
);
// mavlink_message_t* msg = &message;
//qDebug() << "PX RECEIVED" << msg->sysid << msg->compid << msg->msgid;
// Only compile this portion if matching MAVLink packets have been compiled
#ifdef MAVLINK_ENABLED_PIXHAWK
mavlink_message_t
*
msg
=
&
message
;
if
(
message
.
sysid
==
uasId
)
{
...
...
src/ui/MainWindow.cc
View file @
27737cde
...
...
@@ -81,6 +81,11 @@ MainWindow::MainWindow(QWidget *parent) :
// Adjust the size
adjustSize
();
// Set menu
QMenu
*
widgetMenu
=
createPopupMenu
();
widgetMenu
->
setTitle
(
"Widgets"
);
ui
.
menuBar
->
addMenu
(
widgetMenu
);
}
MainWindow
::~
MainWindow
()
...
...
@@ -89,6 +94,46 @@ MainWindow::~MainWindow()
statusBar
=
NULL
;
}
//QList<QWidget* >* MainWindow::getMainWidgets()
//{
//}
//QMenu* QMainWindow::getDockWidgetMenu()
//{
// Q_D(QMainWindow);
// QMenu *menu = 0;
//#ifndef QT_NO_DOCKWIDGET
// QList<QDockWidget *> dockwidgets = qFindChildren<QDockWidget *>(this);
// if (dockwidgets.size()) {
// menu = new QMenu(this);
// for (int i = 0; i < dockwidgets.size(); ++i) {
// QDockWidget *dockWidget = dockwidgets.at(i);
// if (dockWidget->parentWidget() == this
// && d->layout->contains(dockWidget)) {
// menu->addAction(dockwidgets.at(i)->toggleViewAction());
// }
// }
// menu->addSeparator();
// }
//#endif // QT_NO_DOCKWIDGET
//#ifndef QT_NO_TOOLBAR
// QList<QToolBar *> toolbars = qFindChildren<QToolBar *>(this);
// if (toolbars.size()) {
// if (!menu)
// menu = new QMenu(this);
// for (int i = 0; i < toolbars.size(); ++i) {
// QToolBar *toolBar = toolbars.at(i);
// if (toolBar->parentWidget() == this
// && d->layout->contains(toolBar)) {
// menu->addAction(toolbars.at(i)->toggleViewAction());
// }
// }
// }
//#endif
// Q_UNUSED(d);
// return menu;
//}
void
MainWindow
::
buildWidgets
()
{
...
...
@@ -287,6 +332,16 @@ void MainWindow::configureWindowName()
#endif
}
void
MainWindow
::
createCenterWidgetMenu
()
{
}
void
MainWindow
::
createDockWidgetMenu
()
{
}
QStatusBar
*
MainWindow
::
createStatusBar
()
{
QStatusBar
*
bar
=
new
QStatusBar
();
...
...
src/ui/MainWindow.h
View file @
27737cde
...
...
@@ -160,6 +160,9 @@ protected:
void
arrangeCenterStack
();
void
configureWindowName
();
void
createCenterWidgetMenu
();
void
createDockWidgetMenu
();
// TODO Should be moved elsewhere, as the protocol does not belong to the UI
MAVLinkProtocol
*
mavlink
;
AS4Protocol
*
as4link
;
...
...
@@ -168,6 +171,10 @@ protected:
LinkInterface
*
udpLink
;
QSettings
settings
;
// Widget lists
QList
<
QPointer
<
QWidget
>
>
centerWidgets
;
QList
<
QPointer
<
QDockWidget
>
>
dockWidgets
;
// Center widgets
QPointer
<
Linecharts
>
linechartWidget
;
QPointer
<
HUD
>
hudWidget
;
...
...
src/ui/QGCMainWindowAPConfigurator.cc
0 → 100644
View file @
27737cde
#include "QGCMainWindowAPConfigurator.h"
QGCMainWindowAPConfigurator
::
QGCMainWindowAPConfigurator
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
src/ui/QGCMainWindowAPConfigurator.h
0 → 100644
View file @
27737cde
#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/map3D/QGCGoogleEarthView.cc
View file @
27737cde
...
...
@@ -16,9 +16,11 @@
QGCGoogleEarthView
::
QGCGoogleEarthView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
updateTimer
(
new
QTimer
(
this
)),
refreshRateMs
(
200
),
mav
(
NULL
),
followCamera
(
true
),
trailEnabled
(
true
),
webViewInitialized
(
false
),
#if (defined Q_OS_MAC)
webViewMac
(
new
QWebView
(
this
)),
#endif
...
...
@@ -34,22 +36,14 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
#endif
ui
->
setupUi
(
this
);
#if (defined Q_OS_MAC)
ui
->
webViewLayout
->
addWidget
(
webViewMac
);
webViewMac
->
setPage
(
new
QGCWebPage
(
webViewMac
));
webViewMac
->
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
true
);
webViewMac
->
load
(
QUrl
(
"earth.html"
));
#endif
#if (defined Q_OS_WIN) & !(defined __MINGW32__)
webViewWin
->
load
(
QUrl
(
"earth.html"
));
#endif
#if ((defined Q_OS_MAC) | ((defined Q_OS_WIN) & !(defined __MINGW32__)))
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
connect
(
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateState
()));
updateTimer
->
start
(
200
);
updateTimer
->
start
(
refreshRateMs
);
#endif
// Follow checkbox
...
...
@@ -94,9 +88,36 @@ void QGCGoogleEarthView::follow(bool follow)
followCamera
=
follow
;
}
void
QGCGoogleEarthView
::
hide
()
{
updateTimer
->
stop
();
QWidget
::
hide
();
}
void
QGCGoogleEarthView
::
show
()
{
if
(
!
webViewInitialized
)
{
#if (defined Q_OS_MAC)
webViewMac
->
setPage
(
new
QGCWebPage
(
webViewMac
));
webViewMac
->
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
true
);
webViewMac
->
load
(
QUrl
(
"earth.html"
));
#endif
#if (defined Q_OS_WIN) & !(defined __MINGW32__)
webViewWin
->
load
(
QUrl
(
"earth.html"
));
#endif
webViewInitialized
=
true
;
}
updateTimer
->
start
();
QWidget
::
show
();
}
void
QGCGoogleEarthView
::
updateState
()
{
#ifdef Q_OS_MAC
if
(
isVisible
())
{
if
(
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
"isInitialized();"
).
toBool
())
{
static
bool
initialized
=
false
;
...
...
@@ -140,6 +161,7 @@ void QGCGoogleEarthView::updateState()
}
#endif
}
}
void
QGCGoogleEarthView
::
changeEvent
(
QEvent
*
e
)
{
...
...
src/ui/map3D/QGCGoogleEarthView.h
View file @
27737cde
...
...
@@ -62,13 +62,19 @@ public slots:
void
showWaypoints
(
bool
state
);
/** @brief Follow the aircraft during flight */
void
follow
(
bool
follow
);
/** @brief Hide and deactivate */
void
hide
();
/** @brief Show and activate */
void
show
();
protected:
void
changeEvent
(
QEvent
*
e
);
QTimer
*
updateTimer
;
int
refreshRateMs
;
UASInterface
*
mav
;
bool
followCamera
;
bool
trailEnabled
;
bool
webViewInitialized
;
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
WebAxWidget
*
webViewWin
;
#endif
...
...
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