Skip to content
Snippets Groups Projects
Commit 85017a13 authored by Don Gagne's avatar Don Gagne
Browse files

Fix -Werror=type-limits

parent 0422b468
Branches
No related tags found
No related merge requests found
......@@ -362,7 +362,14 @@ void QGCXYPlot::appendData(int uasId, const QString& curve, const QString& unit,
} else
return;
if(x_valid && y_valid && (int)qAbs(y_timestamp_us - x_timestamp_us) <= max_timestamp_diff_us) {
if(x_valid && y_valid) {
quint64 difference;
if (y_timestamp_us < x_timestamp_us) {
difference = x_timestamp_us - y_timestamp_us;
} else {
difference = y_timestamp_us - x_timestamp_us;
}
if (difference <= max_timestamp_diff_us) {
int removed = xycurve->appendData( QPointF(x,y) );
x_valid = false;
y_valid = false;
......@@ -378,6 +385,7 @@ void QGCXYPlot::appendData(int uasId, const QString& curve, const QString& unit,
}
}
}
}
void QGCXYPlot::styleChanged(MainWindow::QGC_MAINWINDOW_STYLE style)
{
......
......@@ -48,7 +48,7 @@ private:
double y; /**< Last unused value for the x-coordinate */
quint64 y_timestamp_us; /**< Timestamp that we last recieved a value for x */
bool y_valid; /**< Whether we have recieved an x value but so far no corresponding y value */
int max_timestamp_diff_us; /**< Only combine x and y to a data point if the timestamp for both doesn't differ by more than this */
quint64 max_timestamp_diff_us; /**< Only combine x and y to a data point if the timestamp for both doesn't differ by more than this */
};
#endif // QGCXYPLOT_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment