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
9e10b726
Commit
9e10b726
authored
Jul 10, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of Advanced Parameter List, with descriptions and names from the XML file
parent
1bf19f54
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
4 deletions
+126
-4
qgroundcontrol.pro
qgroundcontrol.pro
+6
-3
AdvParameterList.cc
src/ui/configuration/AdvParameterList.cc
+55
-0
AdvParameterList.h
src/ui/configuration/AdvParameterList.h
+25
-0
AdvParameterList.ui
src/ui/configuration/AdvParameterList.ui
+31
-0
ApmSoftwareConfig.cc
src/ui/configuration/ApmSoftwareConfig.cc
+7
-0
ApmSoftwareConfig.h
src/ui/configuration/ApmSoftwareConfig.h
+2
-1
No files found.
qgroundcontrol.pro
View file @
9e10b726
...
...
@@ -259,7 +259,8 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
configuration
/
ArduCopterPidConfig
.
ui
\
src
/
ui
/
configuration
/
ApmPlaneLevel
.
ui
\
src
/
ui
/
configuration
/
ParamWidget
.
ui
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
ui
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
ui
\
src
/
ui
/
configuration
/
AdvParameterList
.
ui
INCLUDEPATH
+=
src
\
src
/
ui
\
src
/
ui
/
linechart
\
...
...
@@ -443,7 +444,8 @@ HEADERS += src/MG.h \
src
/
ui
/
configuration
/
ArduCopterPidConfig
.
h
\
src
/
ui
/
configuration
/
ApmPlaneLevel
.
h
\
src
/
ui
/
configuration
/
ParamWidget
.
h
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
h
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
h
\
src
/
ui
/
configuration
/
AdvParameterList
.
h
#
Google
Earth
is
only
supported
on
Mac
OS
and
Windows
with
Visual
Studio
Compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
HEADERS
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
...
...
@@ -645,7 +647,8 @@ SOURCES += src/main.cc \
src
/
ui
/
configuration
/
ArduCopterPidConfig
.
cc
\
src
/
ui
/
configuration
/
ApmPlaneLevel
.
cc
\
src
/
ui
/
configuration
/
ParamWidget
.
cc
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
cc
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
cc
\
src
/
ui
/
configuration
/
AdvParameterList
.
cc
#
Enable
Google
Earth
only
on
Mac
OS
and
Windows
with
Visual
Studio
compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/ui/configuration/AdvParameterList.cc
0 → 100644
View file @
9e10b726
#include "AdvParameterList.h"
AdvParameterList
::
AdvParameterList
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
ui
.
setupUi
(
this
);
ui
.
tableWidget
->
setColumnCount
(
4
);
ui
.
tableWidget
->
horizontalHeader
()
->
hide
();
ui
.
tableWidget
->
verticalHeader
()
->
hide
();
//ui.tableWidget->setHorizontalHeader(0);
//ui.tableWidget->setVerticalHeader(0);
ui
.
tableWidget
->
setColumnWidth
(
0
,
200
);
ui
.
tableWidget
->
setColumnWidth
(
1
,
100
);
ui
.
tableWidget
->
setColumnWidth
(
2
,
200
);
ui
.
tableWidget
->
setColumnWidth
(
3
,
800
);
}
AdvParameterList
::~
AdvParameterList
()
{
}
void
AdvParameterList
::
setParameterMetaData
(
QString
name
,
QString
humanname
,
QString
description
)
{
paramToNameMap
[
name
]
=
humanname
;
paramToDescriptionMap
[
name
]
=
description
;
}
void
AdvParameterList
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
!
paramValueMap
.
contains
(
parameterName
))
{
ui
.
tableWidget
->
setRowCount
(
ui
.
tableWidget
->
rowCount
()
+
1
);
if
(
paramToNameMap
.
contains
(
parameterName
))
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
0
,
new
QTableWidgetItem
(
paramToNameMap
[
parameterName
]));
}
else
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
0
,
new
QTableWidgetItem
(
"Unknown"
));
}
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
,
new
QTableWidgetItem
(
QString
::
number
(
value
.
toFloat
(),
'g'
,
2
)));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
2
,
new
QTableWidgetItem
(
parameterName
));
if
(
paramToDescriptionMap
.
contains
(
parameterName
))
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
paramToDescriptionMap
[
parameterName
]));
}
else
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
"Unknown"
));
}
paramValueMap
[
parameterName
]
=
ui
.
tableWidget
->
item
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
);
}
paramValueMap
[
parameterName
]
->
setText
(
QString
::
number
(
value
.
toFloat
(),
'g'
,
2
));
}
src/ui/configuration/AdvParameterList.h
0 → 100644
View file @
9e10b726
#ifndef ADVPARAMETERLIST_H
#define ADVPARAMETERLIST_H
#include <QWidget>
#include "ui_AdvParameterList.h"
#include "AP2ConfigWidget.h"
class
AdvParameterList
:
public
AP2ConfigWidget
{
Q_OBJECT
public:
explicit
AdvParameterList
(
QWidget
*
parent
=
0
);
void
setParameterMetaData
(
QString
name
,
QString
humanname
,
QString
description
);
~
AdvParameterList
();
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
QMap
<
QString
,
QTableWidgetItem
*>
paramValueMap
;
QMap
<
QString
,
QString
>
paramToNameMap
;
QMap
<
QString
,
QString
>
paramToDescriptionMap
;
Ui
::
AdvParameterList
ui
;
};
#endif // ADVPARAMETERLIST_H
src/ui/configuration/AdvParameterList.ui
0 → 100644
View file @
9e10b726
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
AdvParameterList
</class>
<widget
class=
"QWidget"
name=
"AdvParameterList"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
666
</width>
<height>
497
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
<
h2
>
Advanced Parameter List
<
/h2
>
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QTableWidget"
name=
"tableWidget"
/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
src/ui/configuration/ApmSoftwareConfig.cc
View file @
9e10b726
...
...
@@ -47,6 +47,11 @@ ApmSoftwareConfig::ApmSoftwareConfig(QWidget *parent) : QWidget(parent)
buttonToConfigWidgetMap
[
ui
.
advancedParamButton
]
=
advancedParamConfig
;
connect
(
ui
.
advancedParamButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
advParameterList
=
new
AdvParameterList
(
this
);
ui
.
stackedWidget
->
addWidget
(
advParameterList
);
buttonToConfigWidgetMap
[
ui
.
advParamListButton
]
=
advParameterList
;
connect
(
ui
.
advParamListButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
arduCopterPidConfig
=
new
ArduCopterPidConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
arduCopterPidConfig
);
buttonToConfigWidgetMap
[
ui
.
arduCopterPidButton
]
=
arduCopterPidConfig
;
...
...
@@ -312,6 +317,7 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
{
advancedParamConfig
->
addCombo
(
humanname
,
docs
,
name
,
valuelist
);
}
advParameterList
->
setParameterMetaData
(
name
,
humanname
,
docs
);
}
else
if
(
fieldmap
.
size
()
>
0
)
{
...
...
@@ -341,6 +347,7 @@ void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
{
advancedParamConfig
->
addRange
(
humanname
,
docs
,
name
,
max
,
min
);
}
advParameterList
->
setParameterMetaData
(
name
,
humanname
,
docs
);
}
}
...
...
src/ui/configuration/ApmSoftwareConfig.h
View file @
9e10b726
...
...
@@ -11,7 +11,7 @@
#include "AdvancedParamConfig.h"
#include "ArduCopterPidConfig.h"
#include "ArduPlanePidConfig.h"
#include "AdvParameterList.h"
#include "UASInterface.h"
#include "UASManager.h"
...
...
@@ -35,6 +35,7 @@ private:
AdvancedParamConfig
*
advancedParamConfig
;
ArduCopterPidConfig
*
arduCopterPidConfig
;
ArduPlanePidConfig
*
arduPlanePidConfig
;
AdvParameterList
*
advParameterList
;
QMap
<
QObject
*
,
QWidget
*>
buttonToConfigWidgetMap
;
};
...
...
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