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
fbdbeae3
Commit
fbdbeae3
authored
May 04, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished commenting new parameter widget.
parent
d680d7d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
10 deletions
+96
-10
MainWindow.cc
src/ui/MainWindow.cc
+9
-8
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+55
-2
QGCParamWidget.h
src/ui/QGCParamWidget.h
+32
-0
No files found.
src/ui/MainWindow.cc
View file @
fbdbeae3
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL/PIXHAWK PROJECT
<http://www.qgroundcontrol.org>
<http://pixhawk.ethz.ch>
This file is part of the
PIXHAWK
project
This file is part of the
QGROUNDCONTROL
project
PIXHAWK
is free software: you can redistribute it and/or modify
QGROUNDCONTROL
is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK
is distributed in the hope that it will be useful,
QGROUNDCONTROL
is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with
PIXHAWK
. If not, see <http://www.gnu.org/licenses/>.
along with
QGROUNDCONTROL
. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of class MainWindow
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#include <QSettings>
...
...
src/ui/QGCParamWidget.cc
View file @
fbdbeae3
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL/PIXHAWK PROJECT
<http://www.qgroundcontrol.org>
<http://pixhawk.ethz.ch>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of class QGCParamWidget
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#include <QGridLayout>
#include <QPushButton>
...
...
@@ -5,6 +36,10 @@
#include "UASInterface.h"
#include <QDebug>
/**
* @param uas MAV to set the parameters on
* @param parent Parent widget
*/
QGCParamWidget
::
QGCParamWidget
(
UASInterface
*
uas
,
QWidget
*
parent
)
:
QWidget
(
parent
),
mav
(
uas
),
...
...
@@ -51,6 +86,10 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
connect
(
uas
,
SIGNAL
(
parameterChanged
(
int
,
int
,
QString
,
float
)),
this
,
SLOT
(
addParameter
(
int
,
int
,
QString
,
float
)));
}
/**
* @return The MAV of this widget. Unless the MAV object has been destroyed, this
* pointer is never zero.
*/
UASInterface
*
QGCParamWidget
::
getUAS
()
{
return
mav
;
...
...
@@ -106,6 +145,10 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
tree
->
update
();
}
/**
* Send a request to deliver the list of onboard parameters
* to the MAV.
*/
void
QGCParamWidget
::
requestParameterList
()
{
// Clear view and request param list
...
...
@@ -120,9 +163,12 @@ void QGCParamWidget::requestParameterList()
*/
void
QGCParamWidget
::
setParameter
(
int
component
,
QString
parameterName
,
float
value
)
{
emit
parameterChanged
(
component
,
parameterName
,
value
);
}
/**
* Set all parameter in the parameter tree on the MAV
*/
void
QGCParamWidget
::
setParameters
()
{
//mav->setParameter(component, parameterName, value);
...
...
@@ -140,7 +186,7 @@ void QGCParamWidget::setParameters()
// First column is name, second column value
bool
ok
=
true
;
QString
key
=
param
->
data
(
0
,
Qt
::
DisplayRole
).
toString
();
float
value
=
param
->
data
(
1
,
Qt
::
DisplayRole
).
to
Float
(
&
ok
);
float
value
=
param
->
data
(
1
,
Qt
::
DisplayRole
).
to
Double
(
&
ok
);
// Send parameter to MAV
if
(
ok
)
{
...
...
@@ -158,11 +204,18 @@ void QGCParamWidget::setParameters()
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"SETTING ALL PARAMETERS"
;
}
/**
* Write the current onboard parameters from RAM into
* permanent storage, e.g. EEPROM or harddisk
*/
void
QGCParamWidget
::
writeParameters
()
{
mav
->
writeParameters
();
}
/**
* Clear all data in the parameter widget
*/
void
QGCParamWidget
::
clear
()
{
tree
->
clear
();
...
...
src/ui/QGCParamWidget.h
View file @
fbdbeae3
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL/PIXHAWK PROJECT
<http://www.qgroundcontrol.org>
<http://pixhawk.ethz.ch>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Declaration of class QGCParamWidget
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#ifndef QGCPARAMWIDGET_H
#define QGCPARAMWIDGET_H
...
...
@@ -19,6 +50,7 @@ public:
/** @brief Get the UAS of this widget */
UASInterface
*
getUAS
();
signals:
/** @brief A parameter was changed in the widget, NOT onboard */
void
parameterChanged
(
int
component
,
QString
parametername
,
float
value
);
public
slots
:
/** @brief Add a component to the list */
...
...
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