@@ -100,13 +100,15 @@ public Serial(PApplet parent) {
100100 this (parent , dname , drate , dparity , ddatabits , dstopbits );
101101 }
102102
103+
103104/**
104105 * @param irate 9600 is the default
105106 */
106107 public Serial (PApplet parent , int irate ) {
107108 this (parent , dname , irate , dparity , ddatabits , dstopbits );
108109 }
109110
111+
110112/**
111113 * @param iname name of the port (COM1 is the default)
112114 */
@@ -118,6 +120,7 @@ public Serial(PApplet parent, String iname) {
118120 this (parent , iname , drate , dparity , ddatabits , dstopbits );
119121 }
120122
123+
121124/**
122125 * @param iparity 'N' for none, 'E' for even, 'O' for odd ('N' is the default)
123126 * @param idatabits 8 is the default
@@ -143,8 +146,11 @@ public Serial(PApplet parent, String iname, int irate,
143146 "sudo mkdir -p /var/lock\n " +
144147 "sudo chmod 777 /var/lock" ;
145148 System .err .println (MESSAGE );
146- throw new RuntimeException ("Additional installation required to " +
147- "use serial, read the console below." );
149+ //throw new RuntimeException("Additional installation required to " +
150+ // "use serial, read the console below.");
151+ final String msg =
152+ "Please use Tools \u2192 Fix the Serial Library." ;
153+ throw new RuntimeException (msg );
148154 }
149155 }
150156
@@ -189,7 +195,7 @@ public Serial(PApplet parent, String iname, int irate,
189195 output = null ;
190196 }
191197
192- parent .registerDispose ( this );
198+ parent .registerMethod ( "dispose" , this );
193199
194200 // reflection to check whether host applet has a call for
195201 // public void serialEvent(processing.serial.Serial)
@@ -240,18 +246,19 @@ public void dispose() {
240246
241247
242248 /**
243- * Set the DTR line. Addition from Tom Hulbert.
244- */
249+ * Set the DTR line. Addition from Tom Hulbert.
250+ */
245251 public void setDTR (boolean state ) {
246- port .setDTR (state );
252+ port .setDTR (state );
247253 }
248254
249- /**
250- * @generate serialEvent.xml
251- * @webref serial:events
252- * @usage web_application
253- * @param serialEvent the port where new data is available
254- */
255+
256+ /**
257+ * @generate serialEvent.xml
258+ * @webref serial:events
259+ * @usage web_application
260+ * @param serialEvent the port where new data is available
261+ */
255262 synchronized public void serialEvent (SerialPortEvent serialEvent ) {
256263 if (serialEvent .getEventType () == SerialPortEvent .DATA_AVAILABLE ) {
257264 try {
0 commit comments