Commit 05536245 authored by pixhawk's avatar pixhawk

Improved XML generation, now has 64bit support

parent 067227d9
...@@ -161,7 +161,7 @@ bool MAVLinkXMLParser::generate() ...@@ -161,7 +161,7 @@ bool MAVLinkXMLParser::generate()
} }
else if (fieldType == "uint16_t" || fieldType == "int16_t") else if (fieldType == "uint16_t" || fieldType == "int16_t")
{ {
unpackingCode = QString("\tgeneric_32bit r;\n\tr.b[3] = (msg->payload%1)[0];\n\tr.b[1] = (msg->payload%1)[1];\n\treturn (%2)r.s;").arg(prepends).arg(fieldType); unpackingCode = QString("\tgeneric_16bit r;\n\tr.b[1] = (msg->payload%1)[0];\n\tr.b[0] = (msg->payload%1)[1];\n\treturn (%2)r.s;").arg(prepends).arg(fieldType);
} }
else if (fieldType == "uint32_t" || fieldType == "int32_t") else if (fieldType == "uint32_t" || fieldType == "int32_t")
{ {
...@@ -171,9 +171,9 @@ bool MAVLinkXMLParser::generate() ...@@ -171,9 +171,9 @@ bool MAVLinkXMLParser::generate()
{ {
unpackingCode = QString("\tgeneric_32bit r;\n\tr.b[3] = (msg->payload%1)[0];\n\tr.b[2] = (msg->payload%1)[1];\n\tr.b[1] = (msg->payload%1)[2];\n\tr.b[0] = (msg->payload%1)[3];\n\treturn (%2)r.f;").arg(prepends).arg(fieldType); unpackingCode = QString("\tgeneric_32bit r;\n\tr.b[3] = (msg->payload%1)[0];\n\tr.b[2] = (msg->payload%1)[1];\n\tr.b[1] = (msg->payload%1)[2];\n\tr.b[0] = (msg->payload%1)[3];\n\treturn (%2)r.f;").arg(prepends).arg(fieldType);
} }
else if (fieldType == "uint32_t" || fieldType == "int32_t") else if (fieldType == "uint64_t" || fieldType == "int64_t")
{ {
unpackingCode = QString("\tgeneric_32bit r;\n\tr.b[3] = (msg->payload%1)[0];\n\tr.b[2] = (msg->payload%1)[1];\n\tr.b[1] = (msg->payload%1)[2];\n\tr.b[0] = (msg->payload%1)[3];\n\treturn (%2)r.f;").arg(prepends).arg(fieldType); unpackingCode = QString("\tgeneric_64bit r;\n\tr.b[7] = (msg->payload%1)[0];\n\tr.b[6] = (msg->payload%1)[1];\n\tr.b[5] = (msg->payload%1)[2];\n\tr.b[4] = (msg->payload%1)[3];\n\tr.b[3] = (msg->payload%1)[4];\n\tr.b[2] = (msg->payload%1)[5];\n\tr.b[1] = (msg->payload%1)[6];\n\tr.b[0] = (msg->payload%1)[7];\n\treturn (%2)r.ll;").arg(prepends).arg(fieldType);
} }
else if (fieldType.startsWith("array")) else if (fieldType.startsWith("array"))
{ // fieldtype formatis string[n] where n is the number of bytes, extract n from field type string { // fieldtype formatis string[n] where n is the number of bytes, extract n from field type string
......
...@@ -56,7 +56,8 @@ maxInterval(MAX_STORAGE_INTERVAL), ...@@ -56,7 +56,8 @@ maxInterval(MAX_STORAGE_INTERVAL),
timeScaleStep(DEFAULT_SCALE_INTERVAL), // 10 seconds timeScaleStep(DEFAULT_SCALE_INTERVAL), // 10 seconds
automaticScrollActive(false), automaticScrollActive(false),
d_data(NULL), d_data(NULL),
d_curve(NULL) d_curve(NULL),
m_active(true)
{ {
this->plotid = plotid; this->plotid = plotid;
this->plotInterval = interval; this->plotInterval = interval;
...@@ -188,6 +189,11 @@ void LinechartPlot::setRefreshRate(int ms) ...@@ -188,6 +189,11 @@ void LinechartPlot::setRefreshRate(int ms)
updateTimer->setInterval(ms); updateTimer->setInterval(ms);
} }
//void LinechartPlot::setActive(bool active)
//{
//}
/** /**
* @brief Set the zero (center line) value * @brief Set the zero (center line) value
* The zero value defines the centerline of the plot. * The zero value defines the centerline of the plot.
...@@ -585,7 +591,10 @@ void LinechartPlot::paintRealtime() ...@@ -585,7 +591,10 @@ void LinechartPlot::paintRealtime()
canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, directPaint); canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, directPaint);
#endif #endif
replot(); if (m_active)
{
replot();
}
#ifndef _WIN32 #ifndef _WIN32
canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, oldDirectPaint); canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, oldDirectPaint);
......
...@@ -281,6 +281,7 @@ protected: ...@@ -281,6 +281,7 @@ protected:
bool automaticScrollActive; bool automaticScrollActive;
QTime lastMaxTimeAdded; QTime lastMaxTimeAdded;
int plotid; int plotid;
bool m_active; ///< Decides wether the plot is active or not
// Methods // Methods
void addCurve(QString id); void addCurve(QString id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment