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

View File

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