Merge branch 'serialplotter' of https://github.com/xloem/Arduino

This commit is contained in:
Cristian Maglie 2016-10-03 13:37:58 +02:00
commit bc5c9b8b7e
2 changed files with 7 additions and 3 deletions

View File

@ -87,8 +87,10 @@ public class SerialPlotter extends AbstractMonitor {
minY = Double.POSITIVE_INFINITY;
maxY = Double.NEGATIVE_INFINITY;
for(Graph g : graphs) {
minY = Math.min(g.buffer.min(), minY);
maxY = Math.max(g.buffer.max(), maxY);
if (!g.buffer.isEmpty()) {
minY = Math.min(g.buffer.min(), minY);
maxY = Math.max(g.buffer.max(), maxY);
}
}
final double MIN_DELTA = 10.0;
@ -239,7 +241,7 @@ public class SerialPlotter extends AbstractMonitor {
for(int i = 0; i < parts.length; ++i) {
try {
double value = Double.valueOf(parts[i]);
if(i >= graphs.size()) {
if(validParts >= graphs.size()) {
graphs.add(new Graph(validParts));
}
graphs.get(validParts).buffer.add(value);

View File

@ -1,6 +1,8 @@
ARDUINO 1.6.13
[ide]
* Improved robustness of Serial Plotter while dealing with malformed or partial data. Thanks @xloem.
* Fixed regression on command line upload.
[core]