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
6b29bc4a
Commit
6b29bc4a
authored
Sep 20, 2011
by
LM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on auto params
parent
04dbdee2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
8 deletions
+71
-8
MAVLinkSimulationLink.cc
src/comm/MAVLinkSimulationLink.cc
+8
-0
QGCUASParamManager.h
src/uas/QGCUASParamManager.h
+7
-0
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+8
-7
QGCParamWidget.h
src/ui/QGCParamWidget.h
+8
-0
QGCCommandButton.cc
src/ui/designer/QGCCommandButton.cc
+14
-0
QGCParamSlider.cc
src/ui/designer/QGCParamSlider.cc
+26
-1
No files found.
src/comm/MAVLinkSimulationLink.cc
View file @
6b29bc4a
...
@@ -72,6 +72,14 @@ MAVLinkSimulationLink::MAVLinkSimulationLink(QString readFile, QString writeFile
...
@@ -72,6 +72,14 @@ MAVLinkSimulationLink::MAVLinkSimulationLink(QString readFile, QString writeFile
onboardParams
.
insert
(
"SYS_ID"
,
systemId
);
onboardParams
.
insert
(
"SYS_ID"
,
systemId
);
onboardParams
.
insert
(
"RC4_REV"
,
0
);
onboardParams
.
insert
(
"RC4_REV"
,
0
);
onboardParams
.
insert
(
"RC5_REV"
,
1
);
onboardParams
.
insert
(
"RC5_REV"
,
1
);
onboardParams
.
insert
(
"HDNG2RLL_P"
,
0.7
f
);
onboardParams
.
insert
(
"HDNG2RLL_I"
,
0.01
f
);
onboardParams
.
insert
(
"HDNG2RLL_D"
,
0.02
f
);
onboardParams
.
insert
(
"HDNG2RLL_IMAX"
,
500.0
f
);
onboardParams
.
insert
(
"RLL2SRV_P"
,
0.4
f
);
onboardParams
.
insert
(
"RLL2SRV_I"
,
0.0
f
);
onboardParams
.
insert
(
"RLL2SRV_D"
,
0.0
f
);
onboardParams
.
insert
(
"RLL2SRV_IMAX"
,
500.0
f
);
// Comments on the variables can be found in the header file
// Comments on the variables can be found in the header file
...
...
src/uas/QGCUASParamManager.h
View file @
6b29bc4a
...
@@ -24,6 +24,13 @@ public:
...
@@ -24,6 +24,13 @@ public:
return
parameters
.
value
(
component
)
->
value
(
parameter
);
return
parameters
.
value
(
component
)
->
value
(
parameter
);
}
}
virtual
bool
isParamMinKnown
(
const
QString
&
param
)
=
0
;
virtual
bool
isParamMaxKnown
(
const
QString
&
param
)
=
0
;
virtual
bool
isParamDefaultKnown
(
const
QString
&
param
)
=
0
;
virtual
double
getParamMin
(
const
QString
&
param
)
=
0
;
virtual
double
getParamMax
(
const
QString
&
param
)
=
0
;
virtual
double
getParamDefault
(
const
QString
&
param
)
=
0
;
/** @brief Request an update for the parameter list */
/** @brief Request an update for the parameter list */
void
requestParameterListUpdate
(
int
component
=
0
);
void
requestParameterListUpdate
(
int
component
=
0
);
/** @brief Request an update for this specific parameter */
/** @brief Request an update for this specific parameter */
...
...
src/ui/QGCParamWidget.cc
View file @
6b29bc4a
...
@@ -33,6 +33,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -33,6 +33,7 @@ This file is part of the QGROUNDCONTROL project
#include <QList>
#include <QList>
#include <QSettings>
#include <QSettings>
#include <QMessageBox>
#include <QMessageBox>
#include <QApplication>
#include "QGCParamWidget.h"
#include "QGCParamWidget.h"
#include "UASInterface.h"
#include "UASInterface.h"
...
@@ -150,16 +151,15 @@ void QGCParamWidget::loadSettings()
...
@@ -150,16 +151,15 @@ void QGCParamWidget::loadSettings()
void
QGCParamWidget
::
loadParameterInfoCSV
(
const
QString
&
autopilot
,
const
QString
&
airframe
)
void
QGCParamWidget
::
loadParameterInfoCSV
(
const
QString
&
autopilot
,
const
QString
&
airframe
)
{
{
QDir
appDir
=
Q
Dir
::
current
();
QDir
appDir
=
Q
Application
::
applicationDirPath
();
appDir
.
cd
(
"files"
);
appDir
.
cd
(
"files"
);
QString
fileName
=
QString
(
"/%1/%2/parameter_tooltips/tooltips.txt"
).
arg
(
autopilot
.
toLower
()).
arg
(
airframe
.
toLower
());
QString
fileName
=
QString
(
"%1/%2/%3/parameter_tooltips/tooltips.txt"
).
arg
(
appDir
.
canonicalPath
()).
arg
(
autopilot
.
toLower
()).
arg
(
airframe
.
toLower
());
QString
filePath
=
appDir
.
filePath
(
fileName
);
QFile
paramMetaFile
(
fileName
);
QFile
paramMetaFile
(
filePath
);
// Load CSV data
// Load CSV data
if
(
!
paramMetaFile
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
if
(
!
paramMetaFile
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
{
qDebug
()
<<
"COULD NOT OPEN PARAM META INFO FILE:"
<<
file
Path
;
qDebug
()
<<
"COULD NOT OPEN PARAM META INFO FILE:"
<<
file
Name
;
return
;
return
;
}
}
...
@@ -571,7 +571,7 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
...
@@ -571,7 +571,7 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
if
(
paramDefault
.
contains
(
parameterName
))
if
(
paramDefault
.
contains
(
parameterName
))
{
{
tooltipFormat
=
tr
(
"Default: %1, %2"
);
tooltipFormat
=
tr
(
"Default: %1, %2"
);
tooltipFormat
=
tooltipFormat
.
arg
(
param
ToolTips
.
value
(
parameterName
,
""
),
paramDefault
.
value
(
parameterName
));
tooltipFormat
=
tooltipFormat
.
arg
(
param
Default
.
value
(
parameterName
,
0.0
f
)).
arg
(
paramToolTips
.
value
(
parameterName
,
""
));
}
}
else
else
{
{
...
@@ -590,6 +590,7 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
...
@@ -590,6 +590,7 @@ void QGCParamWidget::addParameter(int uas, int component, QString parameterName,
*/
*/
void
QGCParamWidget
::
requestParameterList
()
void
QGCParamWidget
::
requestParameterList
()
{
{
qDebug
()
<<
"LOADING PARAM LIST"
;
if
(
!
mav
)
return
;
if
(
!
mav
)
return
;
// FIXME This call does not belong here
// FIXME This call does not belong here
// Once the comm handling is moved to a new
// Once the comm handling is moved to a new
...
@@ -615,7 +616,7 @@ void QGCParamWidget::requestParameterList()
...
@@ -615,7 +616,7 @@ void QGCParamWidget::requestParameterList()
// Request twice as mean of forward error correction
// Request twice as mean of forward error correction
mav
->
requestParameters
();
mav
->
requestParameters
();
QGC
::
SLEEP
::
msleep
(
1
0
);
QGC
::
SLEEP
::
msleep
(
1
5
);
mav
->
requestParameters
();
mav
->
requestParameters
();
}
}
...
...
src/ui/QGCParamWidget.h
View file @
6b29bc4a
...
@@ -50,6 +50,14 @@ public:
...
@@ -50,6 +50,14 @@ public:
QGCParamWidget
(
UASInterface
*
uas
,
QWidget
*
parent
=
0
);
QGCParamWidget
(
UASInterface
*
uas
,
QWidget
*
parent
=
0
);
/** @brief Get the UAS of this widget */
/** @brief Get the UAS of this widget */
UASInterface
*
getUAS
();
UASInterface
*
getUAS
();
bool
isParamMinKnown
(
const
QString
&
param
)
{
return
paramMin
.
contains
(
param
);
}
bool
isParamMaxKnown
(
const
QString
&
param
)
{
return
paramMax
.
contains
(
param
);
}
bool
isParamDefaultKnown
(
const
QString
&
param
)
{
return
paramDefault
.
contains
(
param
);
}
double
getParamMin
(
const
QString
&
param
)
{
return
paramMin
.
value
(
param
,
0
.
0
f
);
}
double
getParamMax
(
const
QString
&
param
)
{
return
paramMax
.
value
(
param
,
0
.
0
f
);
}
double
getParamDefault
(
const
QString
&
param
)
{
return
paramDefault
.
value
(
param
,
0
.
0
f
);
}
signals:
signals:
/** @brief A parameter was changed in the widget, NOT onboard */
/** @brief A parameter was changed in the widget, NOT onboard */
void
parameterChanged
(
int
component
,
QString
parametername
,
QVariant
value
);
void
parameterChanged
(
int
component
,
QString
parametername
,
QVariant
value
);
...
...
src/ui/designer/QGCCommandButton.cc
View file @
6b29bc4a
...
@@ -54,6 +54,20 @@ QGCCommandButton::QGCCommandButton(QWidget *parent) :
...
@@ -54,6 +54,20 @@ QGCCommandButton::QGCCommandButton(QWidget *parent) :
ui
->
editCommandComboBox
->
addItem
(
"CUSTOM 14"
,
14
);
ui
->
editCommandComboBox
->
addItem
(
"CUSTOM 14"
,
14
);
ui
->
editCommandComboBox
->
addItem
(
"CUSTOM 15"
,
15
);
ui
->
editCommandComboBox
->
addItem
(
"CUSTOM 15"
,
15
);
ui
->
editCommandComboBox
->
addItem
(
"NAV_WAYPOINT"
,
16
);
ui
->
editCommandComboBox
->
addItem
(
"NAV_WAYPOINT"
,
16
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_LOITER_UNLIM"
,
17
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_LOITER_TURNS"
,
18
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_LOITER_TIME"
,
19
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_RETURN_TO_LAUNCH"
,
20
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_LAND"
,
21
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_TAKEOFF"
,
22
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_ROI"
,
80
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_NAV_PATHPLANNING"
,
81
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_DO_SET_MODE"
,
176
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_DO_CHANGE_SPEED"
,
178
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_DO_SET_HOME"
,
179
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_DO_SET_RELAY"
,
181
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_DO_REPEAT_RELAY"
,
182
);
ui
->
editCommandComboBox
->
addItem
(
"MAV_CMD_DO_SET_SERVO"
,
183
);
ui
->
editCommandComboBox
->
setEditable
(
true
);
ui
->
editCommandComboBox
->
setEditable
(
true
);
}
}
...
...
src/ui/designer/QGCParamSlider.cc
View file @
6b29bc4a
...
@@ -57,7 +57,7 @@ QGCParamSlider::QGCParamSlider(QWidget *parent) :
...
@@ -57,7 +57,7 @@ QGCParamSlider::QGCParamSlider(QWidget *parent) :
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
// Get param value
// Get param value
QTimer
::
singleShot
(
100
0
,
this
,
SLOT
(
requestParameter
()));
QTimer
::
singleShot
(
100
,
this
,
SLOT
(
requestParameter
()));
}
}
QGCParamSlider
::~
QGCParamSlider
()
QGCParamSlider
::~
QGCParamSlider
()
...
@@ -119,7 +119,32 @@ void QGCParamSlider::selectComponent(int componentIndex)
...
@@ -119,7 +119,32 @@ void QGCParamSlider::selectComponent(int componentIndex)
void
QGCParamSlider
::
selectParameter
(
int
paramIndex
)
void
QGCParamSlider
::
selectParameter
(
int
paramIndex
)
{
{
// Set name
parameterName
=
ui
->
editSelectParamComboBox
->
itemText
(
paramIndex
);
parameterName
=
ui
->
editSelectParamComboBox
->
itemText
(
paramIndex
);
// Update min and max values if available
if
(
uas
)
{
if
(
uas
->
getParamManager
())
{
// Current value
uas
->
getParamManager
()
->
requestParameterUpdate
(
component
,
parameterName
);
// Minimum
if
(
uas
->
getParamManager
()
->
isParamMinKnown
(
parameterName
))
{
parameterMin
=
uas
->
getParamManager
()
->
getParamMin
(
parameterName
);
ui
->
editMinSpinBox
->
setValue
(
parameterMin
);
}
// Maximum
if
(
uas
->
getParamManager
()
->
isParamMaxKnown
(
parameterName
))
{
parameterMax
=
uas
->
getParamManager
()
->
getParamMax
(
parameterName
);
ui
->
editMaxSpinBox
->
setValue
(
parameterMax
);
}
}
}
}
}
void
QGCParamSlider
::
startEditMode
()
void
QGCParamSlider
::
startEditMode
()
...
...
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