From cc9a40deb718ff50c99ee83e30ba5dd68dd45e7c Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 9 Jun 2008 19:12:12 +0000 Subject: [PATCH] apply two patches for bufferUntil() and readBytesUntil() in Serial --- core/todo.txt | 2 ++ serial/src/processing/serial/Serial.java | 15 ++++++++++----- todo.txt | 11 +++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/core/todo.txt b/core/todo.txt index fa2916351..faf475c03 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -5,6 +5,8 @@ _ pdf not rendering unicode (though it renders to screen) _ try updating to newer itext _ http://dev.processing.org/bugs/show_bug.cgi?id=727 +_ pdf sketches exiting before writing has finished + _ need a halt() method which will kill but not quit app (sets finished?) _ exit() will actually leave the application _ this may in fact only be internal diff --git a/serial/src/processing/serial/Serial.java b/serial/src/processing/serial/Serial.java index 5de5ae86d..a69b5fe3c 100644 --- a/serial/src/processing/serial/Serial.java +++ b/serial/src/processing/serial/Serial.java @@ -211,7 +211,7 @@ public class Serial implements SerialPortEventListener { * Set the DTR line. Addition from Tom Hulbert. */ public void setDTR(boolean state) { - port.setDTR(state); + port.setDTR(state); } @@ -227,8 +227,10 @@ public class Serial implements SerialPortEventListener { } buffer[bufferLast++] = (byte) input.read(); if (serialEventMethod != null) { - if ((bufferUntil && (buffer[bufferLast-1] == bufferUntilByte)) || - ((bufferLast - bufferIndex) >= bufferSize)) { + if ((bufferUntil && + (buffer[bufferLast-1] == bufferUntilByte)) || + (!bufferUntil && + ((bufferLast - bufferIndex) >= bufferSize))) { try { serialEventMethod.invoke(parent, new Object[] { this }); } catch (Exception e) { @@ -413,8 +415,11 @@ public class Serial implements SerialPortEventListener { byte outgoing[] = new byte[length]; System.arraycopy(buffer, bufferIndex, outgoing, 0, length); - bufferIndex = 0; // rewind - bufferLast = 0; + bufferIndex += length; + if (bufferIndex == bufferLast) { + bufferIndex = 0; // rewind + bufferLast = 0; + } return outgoing; } } diff --git a/todo.txt b/todo.txt index 42dad1330..b815d4faf 100644 --- a/todo.txt +++ b/todo.txt @@ -10,6 +10,9 @@ X can't seem to verify this X occasional division by zero on windows _ http://dev.processing.org/bugs/show_bug.cgi?id=777 _ should be fixed, but need to verify once a release candidate is ready +X two fixes for readBytesUntil() and bufferUntil() +X also not calling serialEvent() +X http://dev.processing.org/bugs/show_bug.cgi?id=96 cleaning o respond to stop/close events sent by the vm @@ -53,6 +56,10 @@ _ how to ignore warning stuff? _ finish osx build script to make the libraries _ make.sh creating work/lib dirs.. no longer necessary? +wontfix +X Programs run with release 0136+ are sometimes slower due to Java 1.5 +X http://dev.processing.org/bugs/show_bug.cgi?id=798 + _ make sure that export is using utf8 for writing the .pde files etc _ should be primarily loadFile() and saveFile() inside Base _ http://dev.processing.org/bugs/show_bug.cgi?id=743 @@ -227,6 +234,7 @@ _ e.g. ocd is broken in 0125 because of method signature changes DOC / Bugzilla +_ _ * disable changes to a bug (except by admin) after closed * _ fix "reply" garbage added _ fix "back to bug# 778" @@ -384,6 +392,7 @@ _ how to do this with subclipse instructions? DOC / Discourse Board +_ auto-close threads when not posted to for 30(?) days _ add basic guidelines for posting to the board _ 0. be polite. going on about how much something "sucks" or is "stupid" will make you look like an eight-year-old. _ 1. don't double (or triple) post @@ -1081,6 +1090,8 @@ _ arrays are reformatted on each autoformat _ http://dev.processing.org/bugs/show_bug.cgi?id=259 _ crash on particular string _ http://dev.processing.org/bugs/show_bug.cgi?id=363 +_ autoformat screws up with color arrays +_ http://dev.processing.org/bugs/show_bug.cgi?id=760 TOOLS / Create Font