Skip to content

Commit

Permalink
mra/plots/GenericPlot: Avoiding "must be finite" exception on plotting.
Browse files Browse the repository at this point in the history
Note:
IllegalArgumentException: Must be finite.
	at org.jfree.chart.axis.NumberTickUnitSource.getCeilingTickUnit(NumberTickUnitSource.java)
  • Loading branch information
paulosousadias committed Mar 26, 2024
1 parent 0e3a60e commit 2fb9150
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/java/pt/lsts/neptus/mra/plots/GenericPlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,16 @@ public void process(LsfIndex source) {
+ field;
}

if (m.getMessageType().getFieldUnits(variable) != null && m.getMessageType().getFieldUnits(variable).startsWith("rad")) {
// Special case for angles in radians
addValue(m.getTimestampMillis(), seriesName, Math.toDegrees(m.getDouble(variable)));
if (Double.isFinite(m.getDouble(variable))) {
if (m.getMessageType().getFieldUnits(variable) != null && m.getMessageType().getFieldUnits(variable).startsWith("rad")) {
// Special case for angles in radians
addValue(m.getTimestampMillis(), seriesName, Math.toDegrees(m.getDouble(variable)));
}
else {
addValue(m.getTimestampMillis(), seriesName, m.getDouble(variable));
}

}
else
addValue(m.getTimestampMillis(), seriesName, m.getDouble(variable));
}
}
}
Expand Down

0 comments on commit 2fb9150

Please sign in to comment.