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
0af3f517
Commit
0af3f517
authored
Jul 18, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:pixhawk/qgroundcontrol into dev
parents
0aad802f
30573ed0
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
211 additions
and
78 deletions
+211
-78
MainWindow.cc
src/ui/MainWindow.cc
+31
-2
MainWindow.h
src/ui/MainWindow.h
+3
-0
MainWindow.ui
src/ui/MainWindow.ui
+10
-0
QGCParamSlider.cc
src/ui/designer/QGCParamSlider.cc
+1
-1
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+149
-68
QGCToolWidget.h
src/ui/designer/QGCToolWidget.h
+14
-4
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+1
-1
Waypoint2DIcon.h
src/ui/map/Waypoint2DIcon.h
+2
-2
No files found.
src/ui/MainWindow.cc
View file @
0af3f517
...
...
@@ -937,17 +937,45 @@ void MainWindow::connectCommonWidgets()
void
MainWindow
::
createCustomWidget
()
{
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
"Unnamed Tool"
,
this
);
QDockWidget
*
dock
=
new
QDockWidget
(
"Unnamed Tool"
,
this
);
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
"Unnamed Tool"
,
dock
);
if
(
QGCToolWidget
::
instances
()
->
size
()
<
2
)
{
// This is the first widget
ui
.
menuTools
->
addSeparator
();
}
QDockWidget
*
dock
=
new
QDockWidget
(
"Unnamed Tool"
,
this
);
connect
(
tool
,
SIGNAL
(
destroyed
()),
dock
,
SLOT
(
deleteLater
()));
dock
->
setWidget
(
tool
);
QAction
*
showAction
=
new
QAction
(
tool
->
getTitle
(),
this
);
showAction
->
setCheckable
(
true
);
connect
(
dock
,
SIGNAL
(
visibilityChanged
(
bool
)),
showAction
,
SLOT
(
setChecked
(
bool
)));
connect
(
showAction
,
SIGNAL
(
triggered
(
bool
)),
dock
,
SLOT
(
setVisible
(
bool
)));
tool
->
setMainMenuAction
(
showAction
);
ui
.
menuTools
->
addAction
(
showAction
);
this
->
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
dock
);
dock
->
setVisible
(
true
);
}
void
MainWindow
::
loadCustomWidget
()
{
QString
widgetFileExtension
(
".qgw"
);
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Specify Widget File Name"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"QGroundControl Widget (*%1);;"
).
arg
(
widgetFileExtension
));
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
""
,
this
);
tool
->
loadSettings
(
fileName
);
if
(
QGCToolWidget
::
instances
()
->
size
()
<
2
)
{
// This is the first widget
ui
.
menuTools
->
addSeparator
();
}
// Add widget to UI
QDockWidget
*
dock
=
new
QDockWidget
(
tool
->
getTitle
(),
this
);
connect
(
tool
,
SIGNAL
(
destroyed
()),
dock
,
SLOT
(
deleteLater
()));
dock
->
setWidget
(
tool
);
tool
->
setParent
(
dock
);
QAction
*
showAction
=
new
QAction
(
"Show Unnamed Tool"
,
this
);
showAction
->
setCheckable
(
true
);
connect
(
dock
,
SIGNAL
(
visibilityChanged
(
bool
)),
showAction
,
SLOT
(
setChecked
(
bool
)));
...
...
@@ -1332,6 +1360,7 @@ void MainWindow::connectCommonActions()
// Custom widget actions
connect
(
ui
.
actionNewCustomWidget
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
createCustomWidget
()));
connect
(
ui
.
actionLoadCustomWidgetFile
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadCustomWidget
()));
// Audio output
ui
.
actionMuteAudioOutput
->
setChecked
(
GAudioOutput
::
instance
()
->
isMuted
());
...
...
src/ui/MainWindow.h
View file @
0af3f517
...
...
@@ -181,6 +181,9 @@ public slots:
/** @brief Add a custom tool widget */
void
createCustomWidget
();
/** @brief Load a custom tool widget from a file */
void
loadCustomWidget
();
void
closeEvent
(
QCloseEvent
*
event
);
/** @brief Load data view, allowing to plot flight data */
...
...
src/ui/MainWindow.ui
View file @
0af3f517
...
...
@@ -111,6 +111,7 @@
<string>
Widgets
</string>
</property>
<addaction
name=
"actionNewCustomWidget"
/>
<addaction
name=
"actionLoadCustomWidgetFile"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuHelp"
>
<property
name=
"title"
>
...
...
@@ -456,6 +457,15 @@
<string>
Esc
</string>
</property>
</action>
<action
name=
"actionLoadCustomWidgetFile"
>
<property
name=
"icon"
>
<iconset
resource=
"../../mavground.qrc"
>
<normaloff>
:/images/status/folder-drag-accept.svg
</normaloff>
:/images/status/folder-drag-accept.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Load Custom Widget File
</string>
</property>
</action>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<resources>
...
...
src/ui/designer/QGCParamSlider.cc
View file @
0af3f517
...
...
@@ -87,7 +87,7 @@ void QGCParamSlider::setActiveUAS(UASInterface* activeUas)
void
QGCParamSlider
::
requestParameter
()
{
if
(
parameterIndex
!=
-
1
)
{
if
(
parameterIndex
!=
-
1
&&
uas
)
{
uas
->
requestParameter
(
this
->
component
,
this
->
parameterIndex
);
}
}
...
...
src/ui/designer/QGCToolWidget.cc
View file @
0af3f517
This diff is collapsed.
Click to expand it.
src/ui/designer/QGCToolWidget.h
View file @
0af3f517
...
...
@@ -23,11 +23,13 @@ public:
~
QGCToolWidget
();
/** @brief Factory method to instantiate all tool widgets */
static
QList
<
QGCToolWidget
*>
createWidgetsFromSettings
(
QWidget
*
parent
);
static
QList
<
QGCToolWidget
*>
createWidgetsFromSettings
(
QWidget
*
parent
,
QString
settingsFile
=
QString
()
);
/** @Give the tool widget a reference to its action in the main menu */
void
setMainMenuAction
(
QAction
*
action
);
/** @brief All instances of this class */
static
QMap
<
QString
,
QGCToolWidget
*>*
instances
();
/** @brief Get title of widget */
const
QString
getTitle
();
int
isVisible
(
int
view
)
{
return
viewVisible
.
value
(
view
,
false
);
}
Qt
::
DockWidgetArea
getDockWidgetArea
(
int
view
)
{
return
dockWidgetArea
.
value
(
view
,
Qt
::
BottomDockWidgetArea
);
}
...
...
@@ -39,9 +41,17 @@ public slots:
/** @brief Export this widget to a file */
void
exportWidget
();
/** @brief Import settings for this widget from a file */
void
importWidget
(
const
QString
&
fileName
);
void
importWidget
();
/** @brief Store all widgets of this type to QSettings */
static
void
storeWidgetsToSettings
();
static
void
storeWidgetsToSettings
(
QString
settingsFile
=
QString
());
/** @brief Load this widget from a QSettings object */
void
loadSettings
(
QSettings
&
settings
);
/** @brief Load this widget from a settings file */
void
loadSettings
(
const
QString
&
settings
);
/** @brief Store this widget to a QSettings object */
void
storeSettings
(
QSettings
&
settings
);
/** @brief Store this widget to a settings file */
void
storeSettings
(
const
QString
&
settingsFile
);
/** @brief Store the view id and dock widget area */
void
setViewVisibilityAndDockWidgetArea
(
int
view
,
bool
visible
,
Qt
::
DockWidgetArea
area
);
...
...
@@ -65,7 +75,6 @@ protected:
void
contextMenuEvent
(
QContextMenuEvent
*
event
);
void
createActions
();
QList
<
QGCToolWidgetItem
*
>*
itemList
();
const
QString
getTitle
();
/** @brief Add an existing tool widget */
void
addToolWidget
(
QGCToolWidgetItem
*
widget
);
...
...
@@ -77,6 +86,7 @@ protected slots:
void
addAction
();
void
addCommand
();
void
setTitle
();
void
setTitle
(
QString
title
);
private:
...
...
src/ui/linechart/LinechartWidget.cc
View file @
0af3f517
...
...
@@ -449,7 +449,7 @@ void LinechartWidget::startLogging()
}
// Let user select the log file name
QDate
date
(
QDate
::
currentDate
());
//
QDate date(QDate::currentDate());
// QString("./pixhawk-log-" + date.toString("yyyy-MM-dd") + "-" + QString::number(logindex) + ".log")
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
),
tr
(
"Logfile (*.csv *.txt);;"
));
...
...
src/ui/map/Waypoint2DIcon.h
View file @
0af3f517
...
...
@@ -42,11 +42,11 @@ public:
protected:
mapcontrol
::
OPMapWidget
*
parent
;
///< Parent widget
int
radius
;
///< Radius / diameter of the icon in pixels
Waypoint
*
waypoint
;
///< Waypoint data container this icon represents
QColor
color
;
int
radius
;
///< Radius / diameter of the icon in pixels
bool
showAcceptanceRadius
;
bool
showOrbit
;
QColor
color
;
// QSize size;
};
...
...
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