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
dcf881a6
Commit
dcf881a6
authored
Jul 23, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #313 from tstellanova/fix_param_saving
Fix parameter formatting on save to file
parents
34da19cf
04030e06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+7
-5
No files found.
src/ui/QGCParamWidget.cc
View file @
dcf881a6
...
...
@@ -705,7 +705,7 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column)
current
->
setBackground
(
1
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
}
switch
(
parameters
.
value
(
key
)
->
value
(
str
).
type
())
switch
(
(
int
)
parameters
.
value
(
key
)
->
value
(
str
).
type
())
{
case
QVariant
:
:
Int
:
{
...
...
@@ -766,7 +766,7 @@ void QGCParamWidget::saveParameters()
{
QString
paramValue
(
"%1"
);
QString
paramType
(
"%1"
);
switch
(
j
.
value
().
type
())
switch
(
(
int
)
j
.
value
().
type
())
{
case
QVariant
:
:
Int
:
paramValue
=
paramValue
.
arg
(
j
.
value
().
toInt
());
...
...
@@ -777,7 +777,9 @@ void QGCParamWidget::saveParameters()
paramType
=
paramType
.
arg
(
MAV_PARAM_TYPE_UINT32
);
break
;
case
QMetaType
:
:
Float
:
paramValue
=
paramValue
.
arg
(
j
.
value
().
toDouble
(),
25
,
'g'
,
12
);
// We store parameters as floats, with only 6 digits of precision guaranteed for decimal string conversion
// (see IEEE 754, 32 bit single-precision)
paramValue
=
paramValue
.
arg
((
double
)
j
.
value
().
toFloat
(),
25
,
'g'
,
6
);
paramType
=
paramType
.
arg
(
MAV_PARAM_TYPE_REAL32
);
break
;
default:
...
...
@@ -955,7 +957,7 @@ void QGCParamWidget::retransmissionGuardTick()
if
(
count
<
retransmissionBurstRequestSize
)
{
// Re-request write operation
QVariant
value
=
missingParams
->
value
(
key
);
switch
(
parameters
.
value
(
component
)
->
value
(
key
).
type
())
switch
(
(
int
)
parameters
.
value
(
component
)
->
value
(
key
).
type
())
{
case
QVariant
:
:
Int
:
{
...
...
@@ -1020,7 +1022,7 @@ void QGCParamWidget::setParameter(int component, QString parameterName, QVariant
return
;
}
switch
(
parameters
.
value
(
component
)
->
value
(
parameterName
).
type
())
switch
(
(
int
)
parameters
.
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