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
87de0f5b
Commit
87de0f5b
authored
Apr 10, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New config windows, dynamically generated based on ANY qgw files in the
configuration directories
parent
cf2bd6a3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
109 deletions
+94
-109
QGCVehicleConfig.cc
src/ui/QGCVehicleConfig.cc
+61
-2
QGCVehicleConfig.ui
src/ui/QGCVehicleConfig.ui
+33
-107
No files found.
src/ui/QGCVehicleConfig.cc
View file @
87de0f5b
...
...
@@ -8,6 +8,7 @@
#endif
#include <QTimer>
#include <QDir>
#include "QGCVehicleConfig.h"
#include "UASManager.h"
...
...
@@ -188,9 +189,66 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
QGCToolWidget
*
tool
;
QDir
autopilotdir
(
qApp
->
applicationDirPath
()
+
"/files/"
+
mav
->
getAutopilotTypeName
().
toLower
());
QDir
generaldir
=
QDir
(
autopilotdir
.
absolutePath
()
+
"/general/widgets"
);
QDir
vehicledir
=
QDir
(
autopilotdir
.
absolutePath
()
+
"/"
+
mav
->
getSystemTypeName
().
toLower
()
+
"/widgets"
);
if
(
!
autopilotdir
.
exists
(
"general"
))
{
//TODO: Throw some kind of error here. There is no general configuration directory
qDebug
()
<<
"invalid general dir"
;
}
if
(
!
autopilotdir
.
exists
(
mav
->
getAutopilotTypeName
().
toLower
()))
{
//TODO: Throw an error here too, no autopilot specific configuration
qDebug
()
<<
"invalid vehicle dir"
;
}
qDebug
()
<<
autopilotdir
.
absolutePath
();
qDebug
()
<<
generaldir
.
absolutePath
();
qDebug
()
<<
vehicledir
.
absolutePath
();
foreach
(
QString
file
,
generaldir
.
entryList
(
QDir
::
Files
|
QDir
::
NoDotAndDotDot
))
{
if
(
file
.
toLower
().
endsWith
(
".qgw"
))
{
tool
=
new
QGCToolWidget
(
""
,
this
);
if
(
tool
->
loadSettings
(
generaldir
.
absoluteFilePath
(
file
),
false
))
{
toolWidgets
.
append
(
tool
);
//ui->sensorLayout->addWidget(tool);
QGroupBox
*
box
=
new
QGroupBox
(
this
);
box
->
setTitle
(
tool
->
objectName
());
box
->
setLayout
(
new
QVBoxLayout
());
box
->
layout
()
->
addWidget
(
tool
);
ui
->
multiRotorAttitudeLayout
->
addWidget
(
box
);
}
else
{
delete
tool
;
}
}
}
foreach
(
QString
file
,
vehicledir
.
entryList
(
QDir
::
Files
|
QDir
::
NoDotAndDotDot
))
{
if
(
file
.
toLower
().
endsWith
(
".qgw"
))
{
tool
=
new
QGCToolWidget
(
""
,
this
);
if
(
tool
->
loadSettings
(
vehicledir
.
absoluteFilePath
(
file
),
false
))
{
toolWidgets
.
append
(
tool
);
//ui->sensorLayout->addWidget(tool);
QGroupBox
*
box
=
new
QGroupBox
(
this
);
box
->
setTitle
(
tool
->
objectName
());
box
->
setLayout
(
new
QVBoxLayout
());
box
->
layout
()
->
addWidget
(
tool
);
ui
->
fixedWingAttitudeLayout
->
addWidget
(
box
);
}
else
{
delete
tool
;
}
}
}
// Load calibration
tool
=
new
QGCToolWidget
(
""
,
this
);
if
(
tool
->
loadSettings
(
defaultsDir
+
"px4_
calibration.qgw"
,
false
))
if
(
tool
->
loadSettings
(
autopilotdir
.
absolutePath
()
+
"/"
+
mav
->
getSystemTypeName
().
toLower
()
+
"/
calibration.qgw"
,
false
))
{
toolWidgets
.
append
(
tool
);
ui
->
sensorLayout
->
addWidget
(
tool
);
...
...
@@ -199,6 +257,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
}
// Load multirotor attitude pid
/*
tool = new QGCToolWidget("", this);
if (tool->loadSettings(defaultsDir + "px4_mc_attitude_pid_params.qgw", false))
{
...
...
@@ -256,7 +315,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
//ui->fixedWingPositionLayout->addWidget(tool);
} else {
delete tool;
}
}
*/
updateStatus
(
QString
(
"Reading from system %1"
).
arg
(
mav
->
getUASName
()));
}
...
...
src/ui/QGCVehicleConfig.ui
View file @
87de0f5b
This diff is collapsed.
Click to expand it.
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