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
05536245
Commit
05536245
authored
Apr 24, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved XML generation, now has 64bit support
parent
067227d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
MAVLinkXMLParser.cc
src/comm/MAVLinkXMLParser.cc
+3
-3
LinechartPlot.cc
src/ui/linechart/LinechartPlot.cc
+11
-2
LinechartPlot.h
src/ui/linechart/LinechartPlot.h
+1
-0
No files found.
src/comm/MAVLinkXMLParser.cc
View file @
05536245
...
...
@@ -161,7 +161,7 @@ bool MAVLinkXMLParser::generate()
}
else
if
(
fieldType
==
"uint16_t"
||
fieldType
==
"int16_t"
)
{
unpackingCode
=
QString
(
"
\t
generic_
32bit r;
\n\t
r.b[3] = (msg->payload%1)[0];
\n\t
r.b[1
] = (msg->payload%1)[1];
\n\t
return (%2)r.s;"
).
arg
(
prepends
).
arg
(
fieldType
);
unpackingCode
=
QString
(
"
\t
generic_
16bit r;
\n\t
r.b[1] = (msg->payload%1)[0];
\n\t
r.b[0
] = (msg->payload%1)[1];
\n\t
return (%2)r.s;"
).
arg
(
prepends
).
arg
(
fieldType
);
}
else
if
(
fieldType
==
"uint32_t"
||
fieldType
==
"int32_t"
)
{
...
...
@@ -171,9 +171,9 @@ bool MAVLinkXMLParser::generate()
{
unpackingCode
=
QString
(
"
\t
generic_32bit r;
\n\t
r.b[3] = (msg->payload%1)[0];
\n\t
r.b[2] = (msg->payload%1)[1];
\n\t
r.b[1] = (msg->payload%1)[2];
\n\t
r.b[0] = (msg->payload%1)[3];
\n\t
return (%2)r.f;"
).
arg
(
prepends
).
arg
(
fieldType
);
}
else
if
(
fieldType
==
"uint
32_t"
||
fieldType
==
"int32
_t"
)
else
if
(
fieldType
==
"uint
64_t"
||
fieldType
==
"int64
_t"
)
{
unpackingCode
=
QString
(
"
\t
generic_
32bit r;
\n\t
r.b[3] = (msg->payload%1)[0];
\n\t
r.b[2] = (msg->payload%1)[1];
\n\t
r.b[1] = (msg->payload%1)[2];
\n\t
r.b[0] = (msg->payload%1)[3];
\n\t
return (%2)r.f
;"
).
arg
(
prepends
).
arg
(
fieldType
);
unpackingCode
=
QString
(
"
\t
generic_
64bit r;
\n\t
r.b[7] = (msg->payload%1)[0];
\n\t
r.b[6] = (msg->payload%1)[1];
\n\t
r.b[5] = (msg->payload%1)[2];
\n\t
r.b[4] = (msg->payload%1)[3];
\n\t
r.b[3] = (msg->payload%1)[4];
\n\t
r.b[2] = (msg->payload%1)[5];
\n\t
r.b[1] = (msg->payload%1)[6];
\n\t
r.b[0] = (msg->payload%1)[7];
\n\t
return (%2)r.ll
;"
).
arg
(
prepends
).
arg
(
fieldType
);
}
else
if
(
fieldType
.
startsWith
(
"array"
))
{
// fieldtype formatis string[n] where n is the number of bytes, extract n from field type string
...
...
src/ui/linechart/LinechartPlot.cc
View file @
05536245
...
...
@@ -56,7 +56,8 @@ maxInterval(MAX_STORAGE_INTERVAL),
timeScaleStep
(
DEFAULT_SCALE_INTERVAL
),
// 10 seconds
automaticScrollActive
(
false
),
d_data
(
NULL
),
d_curve
(
NULL
)
d_curve
(
NULL
),
m_active
(
true
)
{
this
->
plotid
=
plotid
;
this
->
plotInterval
=
interval
;
...
...
@@ -188,6 +189,11 @@ void LinechartPlot::setRefreshRate(int ms)
updateTimer
->
setInterval
(
ms
);
}
//void LinechartPlot::setActive(bool active)
//{
//}
/**
* @brief Set the zero (center line) value
* The zero value defines the centerline of the plot.
...
...
@@ -585,7 +591,10 @@ void LinechartPlot::paintRealtime()
canvas
()
->
setAttribute
(
Qt
::
WA_PaintOutsidePaintEvent
,
directPaint
);
#endif
replot
();
if
(
m_active
)
{
replot
();
}
#ifndef _WIN32
canvas
()
->
setAttribute
(
Qt
::
WA_PaintOutsidePaintEvent
,
oldDirectPaint
);
...
...
src/ui/linechart/LinechartPlot.h
View file @
05536245
...
...
@@ -281,6 +281,7 @@ protected:
bool
automaticScrollActive
;
QTime
lastMaxTimeAdded
;
int
plotid
;
bool
m_active
;
///< Decides wether the plot is active or not
// Methods
void
addCurve
(
QString
id
);
...
...
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