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
0be24ebc
Commit
0be24ebc
authored
Aug 05, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename parameters
parent
13279555
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
QGCUASParamManager.h
src/uas/QGCUASParamManager.h
+7
-8
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+18
-18
No files found.
src/uas/QGCUASParamManager.h
View file @
0be24ebc
...
...
@@ -16,23 +16,23 @@ public:
QGCUASParamManager
(
UASInterface
*
uas
,
QWidget
*
parent
=
0
);
QList
<
QString
>
getParameterNames
(
int
component
)
const
{
return
p
arameters
.
value
(
component
)
->
keys
();
return
onboardP
arameters
.
value
(
component
)
->
keys
();
}
QList
<
QVariant
>
getParameterValues
(
int
component
)
const
{
return
p
arameters
.
value
(
component
)
->
values
();
return
onboardP
arameters
.
value
(
component
)
->
values
();
}
bool
getParameterValue
(
int
component
,
const
QString
&
parameter
,
QVariant
&
value
)
const
{
if
(
!
p
arameters
.
contains
(
component
))
if
(
!
onboardP
arameters
.
contains
(
component
))
{
return
false
;
}
if
(
!
p
arameters
.
value
(
component
)
->
contains
(
parameter
))
if
(
!
onboardP
arameters
.
value
(
component
)
->
contains
(
parameter
))
{
return
false
;
}
value
=
p
arameters
.
value
(
component
)
->
value
(
parameter
);
value
=
onboardP
arameters
.
value
(
component
)
->
value
(
parameter
);
return
true
;
}
...
...
@@ -64,10 +64,9 @@ public slots:
protected:
//Parameter data model
//
Parameter data model
UASInterface
*
mav
;
///< The MAV this widget is controlling
// QMap<int, QMap<QString, QVariant>* > changedValues; ///< Changed values
QMap
<
int
,
QMap
<
QString
,
QVariant
>*
>
parameters
;
///< All parameters
QMap
<
int
,
QMap
<
QString
,
QVariant
>*
>
onboardParameters
;
///< All parameters
UASParameterDataModel
*
paramDataModel
;
///< Shared data model of parameters
// Communications management
...
...
src/ui/QGCParamWidget.cc
View file @
0be24ebc
...
...
@@ -332,8 +332,8 @@ void QGCParamWidget::addComponent(int uas, int component, QString componentName)
tree
->
addTopLevelItem
(
comp
);
tree
->
update
();
// Create map in parameters
if
(
!
p
arameters
.
contains
(
component
))
{
p
arameters
.
insert
(
component
,
new
QMap
<
QString
,
QVariant
>
());
if
(
!
onboardP
arameters
.
contains
(
component
))
{
onboardP
arameters
.
insert
(
component
,
new
QMap
<
QString
,
QVariant
>
());
}
// // Create map in changed parameters
// if (!changedValues.contains(component)) {
...
...
@@ -524,8 +524,8 @@ void QGCParamWidget::receivedParameterUpdate(int uas, int component, QString par
// Replace value in map
// FIXME
if
(
parameters
.
value
(
component
)
->
contains
(
parameterName
))
p
arameters
.
value
(
component
)
->
remove
(
parameterName
);
p
arameters
.
value
(
component
)
->
insert
(
parameterName
,
value
);
if
(
onboardParameters
.
value
(
component
)
->
contains
(
parameterName
))
onboardP
arameters
.
value
(
component
)
->
remove
(
parameterName
);
onboardP
arameters
.
value
(
component
)
->
insert
(
parameterName
,
value
);
QString
splitToken
=
"_"
;
...
...
@@ -666,7 +666,7 @@ void QGCParamWidget::requestParameterList()
// Clear view and request param list
clear
();
p
arameters
.
clear
();
onboardP
arameters
.
clear
();
received
.
clear
();
// Clear transmission state
transmissionListMode
=
true
;
...
...
@@ -715,35 +715,35 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column)
map
->
insert
(
str
,
value
);
// Check if the value was numerically changed
if
(
!
parameters
.
value
(
key
)
->
contains
(
str
)
||
p
arameters
.
value
(
key
)
->
value
(
str
,
value
.
toDouble
()
-
1
)
!=
value
)
{
if
(
!
onboardParameters
.
value
(
key
)
->
contains
(
str
)
||
onboardP
arameters
.
value
(
key
)
->
value
(
str
,
value
.
toDouble
()
-
1
)
!=
value
)
{
current
->
setBackground
(
0
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
current
->
setBackground
(
1
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
}
switch
((
int
)
p
arameters
.
value
(
key
)
->
value
(
str
).
type
())
switch
((
int
)
onboardP
arameters
.
value
(
key
)
->
value
(
str
).
type
())
{
case
QVariant
:
:
Int
:
{
QVariant
fixedValue
(
value
.
toInt
());
p
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
onboardP
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
}
break
;
case
QVariant
:
:
UInt
:
{
QVariant
fixedValue
(
value
.
toUInt
());
p
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
onboardP
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
}
break
;
case
QMetaType
:
:
Float
:
{
QVariant
fixedValue
(
value
.
toFloat
());
p
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
onboardP
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
}
break
;
case
QMetaType
:
:
QChar
:
{
QVariant
fixedValue
(
QChar
((
unsigned
char
)
value
.
toUInt
()));
p
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
onboardP
arameters
.
value
(
key
)
->
insert
(
str
,
fixedValue
);
}
break
;
default:
...
...
@@ -771,7 +771,7 @@ void QGCParamWidget::saveParametersToFile()
// Iterate through all components, through all parameters and emit them
QMap
<
int
,
QMap
<
QString
,
QVariant
>*>::
iterator
i
;
for
(
i
=
parameters
.
begin
();
i
!=
p
arameters
.
end
();
++
i
)
{
for
(
i
=
onboardParameters
.
begin
();
i
!=
onboardP
arameters
.
end
();
++
i
)
{
// Iterate through the parameters of the component
int
compid
=
i
.
key
();
QMap
<
QString
,
QVariant
>*
comp
=
i
.
value
();
...
...
@@ -874,8 +874,8 @@ void QGCParamWidget::loadParametersFromFile()
bool
changed
=
false
;
int
componentId
=
wpParams
.
at
(
1
).
toInt
();
QString
parameterName
=
wpParams
.
at
(
2
);
if
(
!
p
arameters
.
contains
(
componentId
)
||
fabs
((
static_cast
<
float
>
(
p
arameters
.
value
(
componentId
)
->
value
(
parameterName
,
wpParams
.
at
(
3
).
toDouble
()).
toDouble
()))
-
(
wpParams
.
at
(
3
).
toDouble
()))
>
2.0
f
*
FLT_EPSILON
)
{
if
(
!
onboardP
arameters
.
contains
(
componentId
)
||
fabs
((
static_cast
<
float
>
(
onboardP
arameters
.
value
(
componentId
)
->
value
(
parameterName
,
wpParams
.
at
(
3
).
toDouble
()).
toDouble
()))
-
(
wpParams
.
at
(
3
).
toDouble
()))
>
2.0
f
*
FLT_EPSILON
)
{
changed
=
true
;
qDebug
()
<<
"Changed"
<<
parameterName
<<
"VAL"
<<
wpParams
.
at
(
3
).
toDouble
();
}
...
...
@@ -940,7 +940,7 @@ void QGCParamWidget::retransmissionGuardTick()
// Re-request at maximum retransmissionBurstRequestSize parameters at once
// to prevent link flooding
QMap
<
int
,
QMap
<
QString
,
QVariant
>*>::
iterator
i
;
for
(
i
=
parameters
.
begin
();
i
!=
p
arameters
.
end
();
++
i
)
{
for
(
i
=
onboardParameters
.
begin
();
i
!=
onboardP
arameters
.
end
();
++
i
)
{
// Iterate through the parameters of the component
int
component
=
i
.
key
();
// Request n parameters from this component (at maximum)
...
...
@@ -971,7 +971,7 @@ void QGCParamWidget::retransmissionGuardTick()
if
(
count
<
retransmissionBurstRequestSize
)
{
// Re-request write operation
QVariant
value
=
missingParams
->
value
(
key
);
switch
((
int
)
p
arameters
.
value
(
component
)
->
value
(
key
).
type
())
switch
((
int
)
onboardP
arameters
.
value
(
component
)
->
value
(
key
).
type
())
{
case
QVariant
:
:
Int
:
{
...
...
@@ -1035,13 +1035,13 @@ void QGCParamWidget::setParameter(int component, QString parameterName, QVariant
statusLabel
->
setText
(
tr
(
"REJ. %1 > max"
).
arg
(
value
.
toDouble
()));
return
;
}
if
(
p
arameters
.
value
(
component
)
->
value
(
parameterName
)
==
value
)
if
(
onboardP
arameters
.
value
(
component
)
->
value
(
parameterName
)
==
value
)
{
statusLabel
->
setText
(
tr
(
"REJ. %1 > max"
).
arg
(
value
.
toDouble
()));
return
;
}
switch
((
int
)
p
arameters
.
value
(
component
)
->
value
(
parameterName
).
type
())
switch
((
int
)
onboardP
arameters
.
value
(
component
)
->
value
(
parameterName
).
type
())
{
case
QVariant
:
:
Char
:
{
...
...
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