From: <adr...@us...> - 2010-10-07 19:50:42
|
Revision: 3823 http://reprap.svn.sourceforge.net/reprap/?rev=3823&view=rev Author: adrian-bowyer Date: 2010-10-07 19:50:34 +0000 (Thu, 07 Oct 2010) Log Message: ----------- Replacing references to System.err.print with Debug.e. Modified Paths: -------------- trunk/software/host/src/org/reprap/Attributes.java trunk/software/host/src/org/reprap/Main.java trunk/software/host/src/org/reprap/Preferences.java trunk/software/host/src/org/reprap/RFO.java trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java trunk/software/host/src/org/reprap/devices/GenericExtruder.java trunk/software/host/src/org/reprap/geometry/LayerRules.java trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java trunk/software/host/src/org/reprap/geometry/polygons/RrCSG.java trunk/software/host/src/org/reprap/geometry/polygons/RrInterval.java trunk/software/host/src/org/reprap/geometry/polygons/RrRectangle.java trunk/software/host/src/org/reprap/gui/Panel3D.java trunk/software/host/src/org/reprap/gui/Preferences.java trunk/software/host/src/org/reprap/gui/RepRapBuild.java trunk/software/host/src/org/reprap/gui/STLObject.java trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java trunk/software/host/src/org/reprap/gui/botConsole/XYZTabPanel.java trunk/software/host/src/org/reprap/machines/GCodeRepRap.java trunk/software/host/src/org/reprap/machines/GenericRepRap.java trunk/software/host/src/org/reprap/machines/Simulator.java trunk/software/host/src/org/reprap/pcb/PCB.java trunk/software/host/src/org/reprap/utilities/CodeGenerator.java trunk/software/host/src/org/reprap/utilities/RrGraphics.java Modified: trunk/software/host/src/org/reprap/Attributes.java =================================================================== --- trunk/software/host/src/org/reprap/Attributes.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/Attributes.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -5,6 +5,7 @@ import org.reprap.devices.GenericExtruder; import org.reprap.gui.STLObject; +import org.reprap.utilities.Debug; /** * Small class to hold RepRap attributes that are attached to @@ -102,13 +103,13 @@ Printer p = org.reprap.Main.gui.getPrinter(); if(p == null) { - System.err.println("Attributes.getExtruder(): null printer!"); + Debug.e("Attributes.getExtruder(): null printer!"); return null; } e = p.getExtruder(material); if(e == null) { - System.err.println("Attributes.getExtruder(): null extruder for " + material); + Debug.e("Attributes.getExtruder(): null extruder for " + material); return null; } } Modified: trunk/software/host/src/org/reprap/Main.java =================================================================== --- trunk/software/host/src/org/reprap/Main.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/Main.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -100,7 +100,7 @@ printer = MachineFactory.create(); } catch (Exception ex) { - System.err.println("MachineFactory.create() failed.\n"); + Debug.e("MachineFactory.create() failed.\n"); ex.printStackTrace(); } } @@ -319,7 +319,7 @@ if(printer == null) - System.err.println("Production attempted with null printer."); + Debug.e("Production attempted with null printer."); producer = new Producer(printer, builder); producer.setSegmentPause(segmentPause); producer.setLayerPause(layerPause); Modified: trunk/software/host/src/org/reprap/Preferences.java =================================================================== --- trunk/software/host/src/org/reprap/Preferences.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/Preferences.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -102,7 +102,7 @@ fallbackPreferences = new Properties(); mainPreferences = new Properties(); URL fallbackUrl = ClassLoader.getSystemResource(propsFileDist); - //System.out.println("++++ " + fallbackUrl.toString()); + //Debug.a("++++ " + fallbackUrl.toString()); // Construct URL of user properties file String path = new String(System.getProperty("user.home") + File.separatorChar + @@ -219,7 +219,7 @@ return mainPreferences.getProperty(name); if (fallbackPreferences.containsKey(name)) return fallbackPreferences.getProperty(name); - System.err.println("RepRap preference: " + name + " not found in either preference file."); + Debug.e("RepRap preference: " + name + " not found in either preference file."); return null; } @@ -311,7 +311,7 @@ public static void setGlobalString(String name, String value) throws IOException { initIfNeeded(); - //System.err.println("Setting global " + name + ":" + value); + //Debug.e("Setting global " + name + ":" + value); globalPrefs.setString(name, value); } @@ -327,7 +327,7 @@ */ private void setString(String name, String value) { - //System.err.println("Setting " + name + ":" + value); + //Debug.e("Setting " + name + ":" + value); mainPreferences.setProperty(name, value); } Modified: trunk/software/host/src/org/reprap/RFO.java =================================================================== --- trunk/software/host/src/org/reprap/RFO.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/RFO.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -248,7 +248,7 @@ */ public void startDocument () { - //System.out.println("Start document"); + //Debug.a("Start document"); } @@ -257,7 +257,7 @@ */ public void endDocument () { - //System.out.println("End document"); + //Debug.a("End document"); } @@ -355,7 +355,7 @@ { // for (int i = start; i < start + length; i++) // System.out.print(ch[i]); -// System.out.println(); +// Debug.a(); } } @@ -610,11 +610,11 @@ File f = new File(dirToZip, fileList[i]); FileInputStream fis = new FileInputStream(f); String zEntry = f.getPath(); - //System.out.println("\n" + zEntry); + //Debug.a("\n" + zEntry); int start = zEntry.indexOf(uniqueName); zEntry = zEntry.substring(start + uniqueName.length() + 1, zEntry.length()); - //System.out.println(tempDir); - //System.out.println(zEntry + "\n"); + //Debug.a(tempDir); + //Debug.a(zEntry + "\n"); ZipEntry entry = new ZipEntry(zEntry); rfoFile.putNextEntry(entry); while((bytesIn = fis.read(buffer)) != -1) Modified: trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java =================================================================== --- trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -200,7 +200,7 @@ portName = Preferences.loadGlobalString("Port(name)"); } catch (Exception ex) { - System.err.println("Cannot load preference Port(name)."); + Debug.e("Cannot load preference Port(name)."); portName = "stdout"; } @@ -231,7 +231,7 @@ paused = true; // while(!bufferEmpty()) // { -// //System.err.println("Waiting for buffer to empty."); +// //Debug.e("Waiting for buffer to empty."); // sleep (131); // } } @@ -294,7 +294,7 @@ // if(bufferThread == null) // { -// System.err.println("GCodeWriter: attempt to write to non-existent buffer."); +// Debug.e("GCodeWriter: attempt to write to non-existent buffer."); // return true; // } @@ -320,7 +320,7 @@ while(paused) { iAmPaused = true; - //System.err.println("Waiting for pause to end."); + //Debug.e("Waiting for pause to end."); sleep(239); } iAmPaused = false; @@ -790,11 +790,11 @@ CommPortIdentifier commId = CommPortIdentifier.getPortIdentifier(portName); port = (SerialPort)commId.open(portName, 30000); } catch (NoSuchPortException e) { - System.err.println("Error opening port: " + portName); + Debug.e("Error opening port: " + portName); return; } catch (PortInUseException e){ - System.err.println("Port '" + portName + "' is already in use."); + Debug.e("Port '" + portName + "' is already in use."); return; } Main.setRepRapPresent(true); @@ -844,7 +844,7 @@ serialInStream = port.getInputStream(); serialOutStream = new PrintStream(writeStream); } catch (IOException e) { - System.err.println("GCodeWriter: Error opening serial port stream."); + Debug.e("GCodeWriter: Error opening serial port stream."); serialInStream = null; serialOutStream = null; return; @@ -883,13 +883,13 @@ return chooser.getSelectedFile().getName(); } catch (FileNotFoundException e) { - System.err.println("Can't read file " + name); + Debug.e("Can't read file " + name); fileInStream = null; return null; } } else { - System.err.println("Can't read file."); + Debug.e("Can't read file."); fileInStream = null; } @@ -943,7 +943,7 @@ { opFileArray = null; opFileIndex = -1; - System.err.println("Can't write to file '" + opFileName); + Debug.e("Can't write to file '" + opFileName); opFileName = null; fileOutStream = null; } @@ -981,7 +981,7 @@ fileOutStream = new PrintStream(fileStream); } catch (Exception e) { - System.err.println("Can't write to file " + opFileArray[opFileIndex]); + Debug.e("Can't write to file " + opFileArray[opFileIndex]); } } @@ -998,7 +998,7 @@ fileOutStream = new PrintStream(fileStream); } catch (Exception e) { - System.err.println("Can't write to file " + opFileArray[opFileIndex]); + Debug.e("Can't write to file " + opFileArray[opFileIndex]); } } @@ -1025,7 +1025,7 @@ fr.close(); } catch (Exception e) { - System.err.println("Error copying file: " + e.toString()); + Debug.e("Error copying file: " + e.toString()); } } @@ -1044,7 +1044,7 @@ fileOutStream = new PrintStream(fileStream); } catch (Exception e) { - System.err.println("Can't write to file " + opFileName + gcodeExtension); + Debug.e("Can't write to file " + opFileName + gcodeExtension); } copyFile(fileOutStream, opFileArray[0]); Modified: trunk/software/host/src/org/reprap/devices/GenericExtruder.java =================================================================== --- trunk/software/host/src/org/reprap/devices/GenericExtruder.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/devices/GenericExtruder.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -475,12 +475,12 @@ materialColour.setMaterial(new Material(col, black, col, black, 101f)); } catch (Exception ex) { - System.err.println("Refresh extruder preferences: " + ex.toString()); + Debug.e("Refresh extruder preferences: " + ex.toString()); } if(printer == null) { - System.err.println("GenericExtruder(): printer is null!"); + Debug.e("GenericExtruder(): printer is null!"); } else { fastXYFeedrate = Math.min(printer.getFastXYFeedrate(), fastXYFeedrate); @@ -731,7 +731,7 @@ return Preferences.loadGlobalDouble(prefName + "ExtrusionSpeed(mm/minute)"); } catch (Exception e) { - System.err.println(e.toString()); + Debug.e(e.toString()); return 200; //Hack } } @@ -743,7 +743,7 @@ return 3000; //Preferences.loadGlobalDouble(prefName + "SeparationSpeed(mm/minute)"); } catch (Exception e) { - System.err.println(e.toString()); + Debug.e(e.toString()); return 200; //Hack } } @@ -1157,7 +1157,7 @@ (float)Preferences.loadGlobalDouble(prefName + "ColourB(0..1)")); } catch (Exception ex) { - System.err.println(ex.toString()); + Debug.e(ex.toString()); } Appearance a = new Appearance(); a.setMaterial(new Material(col, black, col, black, 101f)); Modified: trunk/software/host/src/org/reprap/geometry/LayerRules.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/LayerRules.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/geometry/LayerRules.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -7,6 +7,7 @@ import org.reprap.geometry.polygons.RrRectangle; import org.reprap.geometry.polygons.Rr2Point; import org.reprap.Preferences; +import org.reprap.utilities.Debug; /** * This stores a set of facts about the layer currently being made, and the @@ -154,7 +155,7 @@ if(es[i].getLowerFineLayers() > fineLayers) fineLayers = es[i].getLowerFineLayers(); if(Math.abs(es[i].getExtrusionHeight() - zStep) > Preferences.tiny()) - System.err.println("Not all extruders extrude the same height of filament: " + + Debug.e("Not all extruders extrude the same height of filament: " + zStep + " and " + es[i].getExtrusionHeight()); } } Modified: trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -98,7 +98,7 @@ public LineSegment(Rr2Point p, Rr2Point q, Attributes at) { if(at == null) - System.err.println("LineSegment(): null attributes!"); + Debug.e("LineSegment(): null attributes!"); a = p; b = q; att = at; @@ -1008,7 +1008,7 @@ break; default: - System.err.println("addEdge(): the | function doesn't seem to work..."); + Debug.e("addEdge(): the | function doesn't seem to work..."); } // Work out the intersection line segment (e1 -> e2) between the z plane and the triangle @@ -1052,7 +1052,7 @@ if(g.getVertexCount()%3 != 0) { - System.err.println("addAllEdges(): shape3D with vertices not a multiple of 3!"); + Debug.e("addAllEdges(): shape3D with vertices not a multiple of 3!"); } if(g != null) { Modified: trunk/software/host/src/org/reprap/geometry/polygons/RrCSG.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/RrCSG.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/geometry/polygons/RrCSG.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -51,6 +51,7 @@ package org.reprap.geometry.polygons; import java.util.ArrayList; +import org.reprap.utilities.Debug; /** * RepRap Constructive Solid Geometry class @@ -192,7 +193,7 @@ public RrCSG(RrCSG c) { if(c == u || c == n) - System.err.println("RrCSG deep copy: copying null or universal set."); + Debug.e("RrCSG deep copy: copying null or universal set."); if(c.hp != null) hp = new RrHalfPlane(c.hp); @@ -262,7 +263,7 @@ break; default: - System.err.println("toString_r(): invalid operator."); + Debug.e("toString_r(): invalid operator."); } return result; } @@ -383,7 +384,7 @@ break; default: - System.err.println("complement(): invalid operator."); + Debug.e("complement(): invalid operator."); return nothing(); } @@ -488,7 +489,7 @@ case 4: return intersection(leafA.complement(), leafB.complement()); case 5: - System.err.println("RrCSG crossCategorise: non-manifold shape (case 0101)!"); + Debug.e("RrCSG crossCategorise: non-manifold shape (case 0101)!"); return union(intersection(leafA, leafB), intersection(leafA.complement(), leafB.complement())); case 6: return leafB.complement(); @@ -499,7 +500,7 @@ case 9: return leafB; case 10: - System.err.println("RrCSG crossCategorise: non-manifold shape (case 1010)!"); + Debug.e("RrCSG crossCategorise: non-manifold shape (case 1010)!"); return union(RrCSG.intersection(leafA.complement(), leafB), intersection(leafA, leafB.complement())); case 11: return union(leafA, leafB); @@ -512,7 +513,7 @@ case 15: return universe(); default: - System.err.println("RrCSG crossCategorise: bitwise | doesn't seem to work..."); + Debug.e("RrCSG crossCategorise: bitwise | doesn't seem to work..."); return this; } } catch (Exception e) @@ -555,7 +556,7 @@ case 7: return universe(); default: - System.err.println("RrCSG crossCategorise: bitwise | doesn't seem to work..."); + Debug.e("RrCSG crossCategorise: bitwise | doesn't seem to work..."); return this; } } @@ -588,7 +589,7 @@ case NULL: case UNIVERSE: - System.err.println("uniqueList_r: null or universe at a leaf."); + Debug.e("uniqueList_r: null or universe at a leaf."); break; case UNION: @@ -598,7 +599,7 @@ break; default: - System.err.println("uniqueList_r: invalid operator."); + Debug.e("uniqueList_r: invalid operator."); } return; @@ -971,7 +972,7 @@ // r = RrCSG.nothing(); // break; // default: -// System.err.println("RrCSG.reg_3(): dud case value: " + caseVal); +// Debug.e("RrCSG.reg_3(): dud case value: " + caseVal); // } // // return r; @@ -1041,7 +1042,7 @@ // result.c2 = c2.c1; // break; // default: -// System.err.println("reg_4() 1: addition doesn't work..."); +// Debug.e("reg_4() 1: addition doesn't work..."); // } // } // } @@ -1105,7 +1106,7 @@ // result = union(c1, c2.c2); // break; // default: -// System.err.println("reg_4() 2: addition doesn't work..."); +// Debug.e("reg_4() 2: addition doesn't work..."); // } // break; // @@ -1117,7 +1118,7 @@ // break; // // default: -// System.err.println("reg_4() 4: addition doesn't work..."); +// Debug.e("reg_4() 4: addition doesn't work..."); // } // } // @@ -1189,7 +1190,7 @@ // break; // // default: -// System.err.println("regularise(): set too complicated."); +// Debug.e("regularise(): set too complicated."); // } // // return result; @@ -1237,7 +1238,7 @@ break; default: - System.err.println("replace_all_same(): invalid operator."); + Debug.e("replace_all_same(): invalid operator."); } } @@ -1268,7 +1269,7 @@ break; default: - System.err.println("simplify_r(): invalid operator."); + Debug.e("simplify_r(): invalid operator."); } } @@ -1351,7 +1352,7 @@ break; default: - System.err.println("offset(): invalid operator."); + Debug.e("offset(): invalid operator."); result = nothing(); } return result; @@ -1398,7 +1399,7 @@ return r2; default: - System.err.println("leaf(Rr2Point): invalid operator."); + Debug.e("leaf(Rr2Point): invalid operator."); result = nothing(); } return result; @@ -1438,7 +1439,7 @@ break; default: - System.err.println("RrCSG.value(): dud operator."); + Debug.e("RrCSG.value(): dud operator."); } return result; } @@ -1472,7 +1473,7 @@ // case INTERSECTION: // // default: -// System.err.println("value(Rr2Point): non-leaf operator."); +// Debug.e("value(Rr2Point): non-leaf operator."); // } // return result; // } @@ -1509,7 +1510,7 @@ break; default: - System.err.println("value(RrBox): invalid operator."); + Debug.e("value(RrBox): invalid operator."); result = new RrInterval(); } @@ -1530,7 +1531,7 @@ case LEAF: RrInterval i = hp.value(b); if (i.empty()) - System.err.println("RrCSG.prune(RrBox): empty interval!"); + Debug.e("RrCSG.prune(RrBox): empty interval!"); else if(i.neg()) result = universe(); else if (i.pos()) @@ -1550,7 +1551,7 @@ break; default: - System.err.println("RrCSG.prune(RrBox): dud op value!"); + Debug.e("RrCSG.prune(RrBox): dud op value!"); } return result; Modified: trunk/software/host/src/org/reprap/geometry/polygons/RrInterval.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/RrInterval.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/geometry/polygons/RrInterval.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -55,6 +55,8 @@ package org.reprap.geometry.polygons; +import org.reprap.utilities.Debug; + /** * Real 1D intervals */ @@ -190,7 +192,7 @@ public static RrInterval add(RrInterval a, RrInterval b) { if(a.empty || b.empty) - System.err.println("add(...): adding empty interval(s)."); + Debug.e("RrInterval.add(...): adding empty interval(s)."); return new RrInterval(a.low + b.low, a.high + b.high); } @@ -202,7 +204,7 @@ public static RrInterval add(RrInterval a, double b) { if(a.empty) - System.err.println("add(...): adding an empty interval."); + Debug.e("RrInterval.add(...): adding an empty interval."); return new RrInterval(a.low + b, a.high + b); } @@ -226,7 +228,7 @@ public static RrInterval sub(RrInterval a, RrInterval b) { if(a.empty || b.empty) - System.err.println("difference(...): subtracting empty interval(s)."); + Debug.e("RrInterval.sub(...): subtracting empty interval(s)."); return new RrInterval(a.low - b.high, a.high - b.low); } @@ -238,7 +240,7 @@ public static RrInterval sub(RrInterval a, double b) { if(a.empty) - System.err.println("difference(...): subtracting an empty interval."); + Debug.e("RrInterval.sub(...): subtracting an empty interval."); return new RrInterval(a.low - b, a.high - b); } @@ -250,7 +252,7 @@ public static RrInterval sub(double b, RrInterval a) { if(a.empty) - System.err.println("difference(...): subtracting an empty interval."); + Debug.e("RrInterval.sub(...): subtracting an empty interval."); return new RrInterval(b - a.high, b - a.low); } @@ -263,7 +265,7 @@ public static RrInterval mul(RrInterval a, RrInterval b) { if(a.empty || b.empty) - System.err.println("multiply(...): multiplying empty intervals."); + Debug.e("RrInterval.mul(...): multiplying empty intervals."); double d = a.low*b.low; RrInterval r = new RrInterval(d, d); r.expand(a.low*b.high); @@ -280,7 +282,7 @@ public static RrInterval mul(RrInterval a, double f) { if(a.empty) - System.err.println("multiply(...): multiplying an empty interval."); + Debug.e("RrInterval.mul(...): multiplying an empty interval."); if(f > 0) return new RrInterval(a.low*f, a.high*f); else Modified: trunk/software/host/src/org/reprap/geometry/polygons/RrRectangle.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/RrRectangle.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/geometry/polygons/RrRectangle.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -46,7 +46,7 @@ ===================================================================== - RrBox: 2D rectangles + RrRectangle: 2D rectangles First version 20 May 2005 This version: 1 May 2006 (Now in CVS - no more comments here) @@ -55,6 +55,8 @@ package org.reprap.geometry.polygons; +import org.reprap.utilities.Debug; + /** * A 2D box is an X and a Y interval */ @@ -127,7 +129,7 @@ // * For when we need one that has just something in // * @param a // */ -// public RrBox(double a) +// public RrRectangle(double a) // { // x = new RrInterval(0, a); // y = new RrInterval(0, a); @@ -374,7 +376,7 @@ return Rr2Point.dSquared(p, sw()); default: - System.err.println("RrBox.dSquared(): dud value from point_relative()!"); + Debug.e("RrRectangle.dSquared(): dud value from point_relative()!"); } return Math.min(d1, d2); Modified: trunk/software/host/src/org/reprap/gui/Panel3D.java =================================================================== --- trunk/software/host/src/org/reprap/gui/Panel3D.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/gui/Panel3D.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -33,6 +33,8 @@ import com.sun.j3d.audioengines.javasound.JavaSoundMixer; +import org.reprap.utilities.Debug; + abstract public class Panel3D extends JPanel { private static final long serialVersionUID = 1L; //------------------------------------------------------------- @@ -152,7 +154,7 @@ (float)Preferences.loadGlobalDouble("UnselectedColourB(0..1)")); } catch (Exception ex) { - System.err.println("Refresh Panel3D preferences: " + ex.toString()); + Debug.e("Refresh Panel3D preferences: " + ex.toString()); } // End of stuff from the preferences file @@ -218,7 +220,7 @@ File file = new File(System.getProperty("user.dir")); return file.toURI().toURL(); } catch (Exception e) { - System.err.println("getWorkingDirectory( ): can't get user dir."); + Debug.e("getWorkingDirectory( ): can't get user dir."); } //return getCodeBase( ); @@ -323,7 +325,7 @@ JavaSoundMixer javaSoundMixer = new JavaSoundMixer(pe); if (javaSoundMixer == null) - System.err.println("create of audiodevice failed"); + Debug.e("create of audiodevice failed"); return javaSoundMixer; } @@ -533,8 +535,7 @@ // stlURL = u.toExternalForm();//u.getFile(); //// System.out.println(stlPath + " : " + stlURL); // } catch (Exception e) { -// System.err -// .println("createSceneBranchGroup(): Exception finding working directory: " +// Debug.e("createSceneBranchGroup(): Exception finding working directory: " // + codebase.toExternalForm()); // e.printStackTrace(); // } Modified: trunk/software/host/src/org/reprap/gui/Preferences.java =================================================================== --- trunk/software/host/src/org/reprap/gui/Preferences.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/gui/Preferences.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -24,6 +24,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import org.reprap.utilities.Debug; + /** * This reads in the preferences file and constructs a set of menus from it to allow entries * to be edited. @@ -125,7 +127,7 @@ { String s = globalValues[i].getText(); if(category(s) != globalCats[i]) - System.err.println("Dud format for " + globals[i].getText() + ": " + s); + Debug.e("Preferences window: Dud format for " + globals[i].getText() + ": " + s); else saveString(globals[i].getText(), s); } @@ -139,7 +141,7 @@ { String s = evals[i].getText(); if(category(s) != cats[i]) - System.err.println("Dud format for " + enames[i].getText() + ": " + s); + Debug.e("Preferences window: Dud format for " + enames[i].getText() + ": " + s); else saveString(enames[i].getText(), s); } @@ -172,7 +174,7 @@ globalCats = categorise(globalValues); }catch (Exception ex) { - System.err.println("Preferences window: Can't load the globals!"); + Debug.e("Preferences window: Can't load the globals!"); ex.printStackTrace(); } @@ -182,7 +184,7 @@ extruderCount = Integer.parseInt(loadString("NumberOfExtruders")); } catch (Exception ex) { - System.err.println("Preferences window: Can't load the extruder count!"); + Debug.e("Preferences window: Can't load the extruder count!"); ex.printStackTrace(); } @@ -202,7 +204,7 @@ } }catch (Exception ex) { - System.err.println("Preferences window: Can't load extruder(s)!"); + Debug.e("Preferences window: Can't load extruder(s)!"); ex.printStackTrace(); } @@ -312,7 +314,7 @@ String configPath = org.reprap.Preferences.getProbsFolderPath() + configName; if((new File(configPath)).exists()) { - System.out.println("loading config " + configName); + Debug.a("loading config " + configName); org.reprap.Preferences.loadConfig(configName); updatePreferencesValues(); @@ -339,7 +341,7 @@ if(!configFileObj.exists()) { configfileList.addItem(configfileList.getSelectedItem()); - System.out.println("loading config " + configName); + Debug.a("loading config " + configName); org.reprap.Preferences.loadConfig(configName); updatePreferencesValues(); Modified: trunk/software/host/src/org/reprap/gui/RepRapBuild.java =================================================================== --- trunk/software/host/src/org/reprap/gui/RepRapBuild.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/gui/RepRapBuild.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -128,6 +128,7 @@ import org.reprap.RFO; import org.reprap.Preferences; import org.reprap.geometry.polygons.AllSTLsToBuild; +import org.reprap.utilities.Debug; /** * Little class to put up a radiobutton menu so you can set @@ -199,7 +200,7 @@ } catch (Exception ex) { - System.err.println(ex.toString()); + Debug.e(ex.toString()); ex.printStackTrace(); } } Modified: trunk/software/host/src/org/reprap/gui/STLObject.java =================================================================== --- trunk/software/host/src/org/reprap/gui/STLObject.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/gui/STLObject.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -83,6 +83,7 @@ import org.j3d.renderer.java3d.loaders.STLLoader; import org.reprap.Attributes; import org.reprap.Preferences; +import org.reprap.utilities.Debug; /** * Class for holding a group (maybe just 1) of 3D objects for RepRap to make. @@ -295,7 +296,7 @@ } catch ( Exception e ) { - System.err.println("loadSingelSTL(): Exception loading STL file from: " + Debug.e("loadSingelSTL(): Exception loading STL file from: " + location); e.printStackTrace(); } @@ -445,7 +446,7 @@ //restoreAppearance(); } else - System.err.println("applyOffset(): no bounding box or child."); + Debug.e("applyOffset(): no bounding box or child."); return result; } @@ -711,7 +712,7 @@ if(att != null) setAppearance_r(b, att.getAppearance()); else - System.err.println("restoreAppearance(): no Attributes!"); + Debug.e("restoreAppearance(): no Attributes!"); } } } Modified: trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java =================================================================== --- trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -13,6 +13,7 @@ package org.reprap.gui.botConsole; import org.reprap.Preferences; +import org.reprap.utilities.Debug; import javax.swing.JOptionPane; @@ -42,7 +43,7 @@ checkPrefs(); } catch (Exception e) { - System.err.println("Failure trying to initialise comms in botConsole: " + e); + Debug.e("Failure trying to initialise comms in botConsole: " + e); JOptionPane.showMessageDialog(null, e.getMessage()); return; } @@ -273,7 +274,7 @@ { if(i >= 0 && i < bcf.extruderPanels.length) return bcf.extruderPanels[i]; - System.err.println("getGenericExtruderTabPanel - extruder out of range: " + i); + Debug.e("getGenericExtruderTabPanel - extruder out of range: " + i); return bcf.extruderPanels[0]; } Modified: trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java =================================================================== --- trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -5,10 +5,13 @@ */ package org.reprap.gui.botConsole; + import java.io.IOException; import javax.swing.JOptionPane; import org.reprap.Preferences; import org.reprap.Printer; +import org.reprap.utilities.Debug; + //import org.reprap.AxisMotor; //import org.reprap.comms.Communicator; //import org.reprap.comms.snap.SNAPAddress; @@ -64,7 +67,7 @@ default: axis = "X"; //motor = printer.getXMotor(); - System.err.println("StepperPanel - dud axis id:" + motorID); + Debug.e("StepperPanel - dud axis id:" + motorID); } // if(!motor.isAvailable()) @@ -138,7 +141,7 @@ printer.homeToZeroZ(); break; default: - System.err.println("StepperPositionPanel - homeReset. Dud motor id: " + motorID); + Debug.e("StepperPositionPanel - homeReset. Dud motor id: " + motorID); } //motor.homeReset(getSpeedFromFeed(currentSpeed)); zeroBox(); @@ -205,7 +208,7 @@ z = p; break; default: - System.err.println("moveToTarget() Dud motor id: " + motorID); + Debug.e("moveToTarget() Dud motor id: " + motorID); } printer.singleMove(x, y, z, currentSpeed); //printer.moveTo(x, y, z, currentSpeed, false, false); @@ -421,7 +424,7 @@ // pos = printer.getZ(); // break; // default: -// System.err.println("store() Dud motor id: " + motorID); +// Debug.e("store() Dud motor id: " + motorID); // } // try // { Modified: trunk/software/host/src/org/reprap/gui/botConsole/XYZTabPanel.java =================================================================== --- trunk/software/host/src/org/reprap/gui/botConsole/XYZTabPanel.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/gui/botConsole/XYZTabPanel.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -81,7 +81,7 @@ xStepperPositionJPanel.postSetUp(1); yStepperPositionJPanel.postSetUp(2); zStepperPositionJPanel.postSetUp(3); - } catch (Exception ex) {System.err.println(ex.toString());} + } catch (Exception ex) {Debug.e(ex.toString());} setMotorSpeeds(); setNudgeSize(Double.parseDouble(nudgeSizeRB1.getText())); agitate = false; Modified: trunk/software/host/src/org/reprap/machines/GCodeRepRap.java =================================================================== --- trunk/software/host/src/org/reprap/machines/GCodeRepRap.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/machines/GCodeRepRap.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -91,7 +91,7 @@ if(xyFeedrate < feedrate) { - System.err.println("GCodeRepRap().qXYMove: feedrate (" + feedrate + ") exceeds maximum (" + xyFeedrate + ")."); + Debug.e("GCodeRepRap().qXYMove: feedrate (" + feedrate + ") exceeds maximum (" + xyFeedrate + ")."); feedrate = xyFeedrate; } @@ -146,7 +146,7 @@ if(zFeedrate < feedrate) { - System.err.println("GCodeRepRap().qZMove: feedrate (" + feedrate + ") exceeds maximum (" + zFeedrate + ")."); + Debug.e("GCodeRepRap().qZMove: feedrate (" + feedrate + ") exceeds maximum (" + zFeedrate + ")."); feedrate = zFeedrate; } @@ -214,7 +214,7 @@ boolean xyMove = dx!= 0 || dy != 0; if(zMove && xyMove) - System.err.println("GcodeRepRap.moveTo(): attempt to move in X|Y and Z simultaneously: (x, y, z) = (" + x + ", " + y + ", " + z + ")"); + Debug.e("GcodeRepRap.moveTo(): attempt to move in X|Y and Z simultaneously: (x, y, z) = (" + x + ", " + y + ", " + z + ")"); double zFeedrate = round(getMaxFeedrateZ(), 1); @@ -269,7 +269,7 @@ boolean xyMove = dx != 0 || dy != 0; if(zMove && xyMove) - System.err.println("GcodeRepRap.singleMove(): attempt to move in X|Y and Z simultaneously: (x, y, z) = (" + x + ", " + y + ", " + z + ")"); + Debug.e("GcodeRepRap.singleMove(): attempt to move in X|Y and Z simultaneously: (x, y, z) = (" + x + ", " + y + ", " + z + ")"); try { @@ -306,7 +306,7 @@ break; default: - System.err.println("GCodeRepRap.singleMove(): dud VelocityProfile XY flat value."); + Debug.e("GCodeRepRap.singleMove(): dud VelocityProfile XY flat value."); } } @@ -338,12 +338,12 @@ break; default: - System.err.println("GCodeRepRap.singleMove(): dud VelocityProfile Z flat value."); + Debug.e("GCodeRepRap.singleMove(): dud VelocityProfile Z flat value."); } } } catch (Exception e) { - System.err.println(e.toString()); + Debug.e(e.toString()); } } Modified: trunk/software/host/src/org/reprap/machines/GenericRepRap.java =================================================================== --- trunk/software/host/src/org/reprap/machines/GenericRepRap.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/machines/GenericRepRap.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -302,7 +302,7 @@ } catch (Exception ex) { - System.err.println("Refresh Reprap preferences: " + ex.toString()); + Debug.e("Refresh Reprap preferences: " + ex.toString()); } for(int i = 0; i < extruders.length; i++) @@ -365,7 +365,7 @@ if(materialIndex < 0 || materialIndex >= extruders.length) { - System.err.println("Selected material (" + materialIndex + ") is out of range."); + Debug.e("Selected material (" + materialIndex + ") is out of range."); extruder = 0; } else extruder = materialIndex; @@ -396,7 +396,7 @@ return; } } - System.err.println("selectExtruder() - extruder not found for: " + att.getMaterial()); + Debug.e("selectExtruder() - extruder not found for: " + att.getMaterial()); } /** @@ -655,7 +655,7 @@ moveTo(x, y, z, feedrate, false, false); } catch (Exception e) { - System.err.println(e.toString()); + Debug.e(e.toString()); } } @@ -665,11 +665,11 @@ */ // public void printTo(double x, double y, double z, boolean turnOff) throws ReprapException, IOException // { -// System.err.println("printing"); +// Debug.e("printing"); // if (previewer != null) // previewer.addSegment(currentX, currentY, currentZ, x, y, z); // else -// System.err.println("previewer null!"); +// Debug.e("previewer null!"); // // if (isCancelled()) // return; Modified: trunk/software/host/src/org/reprap/machines/Simulator.java =================================================================== --- trunk/software/host/src/org/reprap/machines/Simulator.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/machines/Simulator.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -5,6 +5,7 @@ import org.reprap.Extruder; //import org.reprap.devices.NullStepperMotor; import org.reprap.devices.NullExtruder; +import org.reprap.utilities.Debug; /** * @@ -149,7 +150,7 @@ */ public String loadGCodeFileForMaking() { - System.err.println("Simulator: attempt to load GCode file."); + Debug.e("Simulator: attempt to load GCode file."); //super.loadGCodeFileForMaking(); return null; } @@ -160,7 +161,7 @@ */ public String setGCodeFileForOutput(String fileRoot) { - System.err.println("Simulator: cannot generate GCode file."); + Debug.e("Simulator: cannot generate GCode file."); return null; } Modified: trunk/software/host/src/org/reprap/pcb/PCB.java =================================================================== --- trunk/software/host/src/org/reprap/pcb/PCB.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/pcb/PCB.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -83,7 +83,7 @@ } catch (Exception ex) { - System.err.println(ex.toString()); + Debug.e(ex.toString()); ex.printStackTrace(); } } Modified: trunk/software/host/src/org/reprap/utilities/CodeGenerator.java =================================================================== --- trunk/software/host/src/org/reprap/utilities/CodeGenerator.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/utilities/CodeGenerator.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -61,7 +61,7 @@ String n; public Variable(String s) { init = false; n = s;} - public boolean value() { if(!init) System.err.println("Variable undefined!"); return bv; } + public boolean value() { if(!init) Debug.e("Variable undefined!"); return bv; } public boolean isSet() { return init; } public void set(boolean b) { bv = b; init = true;} public String name() { return n; } @@ -70,7 +70,7 @@ public Variable(Variable v) { if(!v.init) - System.err.println("Variable(Variable v): input Variable undefined!"); + Debug.e("Variable(Variable v): input Variable undefined!"); bv = v.bv; init = v.init; n = new String(v.n); @@ -194,7 +194,7 @@ break; default: - System.err.println("BooleanExpression(...): variable number not 3 or 4!"); + Debug.e("BooleanExpression(...): variable number not 3 or 4!"); } } @@ -233,7 +233,7 @@ { leafCount = -1; if(!op.diadic()) - System.err.println("BooleanExpression(a, b): leaf operator or NOT!"); + Debug.e("BooleanExpression(a, b): leaf operator or NOT!"); leafOp = op; leaf = null; @@ -251,7 +251,7 @@ { leafCount = -1; if(op != Bop.NOT) - System.err.println("BooleanExpression(..., NOT): op not NOT!"); + Debug.e("BooleanExpression(..., NOT): op not NOT!"); leafOp = op; leaf = null; @@ -333,7 +333,7 @@ if(v == variables[i]) return i; } - System.err.println("getIndex(): variable not found!"); + Debug.e("getIndex(): variable not found!"); return -1; } @@ -379,7 +379,7 @@ return r ^ c2.value(); default: - System.err.println("generateValue_r: dud operator!"); + Debug.e("generateValue_r: dud operator!"); } return false; } @@ -420,11 +420,11 @@ return r; case XOR: - System.err.println("toJava(): got to an XOR..."); + Debug.e("toJava(): got to an XOR..."); break; default: - System.err.println("toJava(): dud operator"); + Debug.e("toJava(): dud operator"); } return r; @@ -632,7 +632,7 @@ if(rows.size() > 0) { if(!TableRow.sameOrder(newOne.all(), rows.get(0).all())) - System.err.println("FunctionTable.addRow() - variable lists different!"); + Debug.e("FunctionTable.addRow() - variable lists different!"); } rows.add(newOne); @@ -648,12 +648,12 @@ leng *= 2; if(leng != rows.size()) - System.err.println("FunctionTable.tableCheck() - incorrect entry count: " + rows.size() + + Debug.e("FunctionTable.tableCheck() - incorrect entry count: " + rows.size() + "(should be " + leng + ")"); Collections.sort(rows, new TableRow()); for(int i = 1; i < rows.size(); i++) if(rows.get(i-1).number() == rows.get(i).number()) - System.err.println("FunctionTable.tableDone() - identical rows: " + rows.get(i-1).toString() + + Debug.e("FunctionTable.tableDone() - identical rows: " + rows.get(i-1).toString() + rows.get(i).toString()); } @@ -784,7 +784,7 @@ static List<BooleanExpression> generateAllPairs(BooleanExpression[] b2) { if(b2.length != 2) - System.err.println("generateAllPairs: array not of length 2: " + b2.length); + Debug.e("generateAllPairs: array not of length 2: " + b2.length); List<BooleanExpression> bel2 = new ArrayList<BooleanExpression>(); @@ -858,7 +858,7 @@ static BooleanExpression findEqualTwo(FunctionTable f, Variable[] v) { if(v.length != 2) - System.err.println("findEqualTwo: array not of length 2: " + v.length); + Debug.e("findEqualTwo: array not of length 2: " + v.length); BooleanExpression[] b2 = new BooleanExpression[2]; b2[0] = new BooleanExpression(v[0]); b2[1] = new BooleanExpression(v[1]); @@ -879,7 +879,7 @@ static BooleanExpression findEqualThree(FunctionTable f, Variable[] v) { if(v.length != 3) - System.err.println("findEqualThree: array not of length 3: " + v.length); + Debug.e("findEqualThree: array not of length 3: " + v.length); BooleanExpression[] b3 = new BooleanExpression[3]; b3[0] = new BooleanExpression(v[0]); b3[1] = new BooleanExpression(v[1]); Modified: trunk/software/host/src/org/reprap/utilities/RrGraphics.java =================================================================== --- trunk/software/host/src/org/reprap/utilities/RrGraphics.java 2010-10-07 17:01:38 UTC (rev 3822) +++ trunk/software/host/src/org/reprap/utilities/RrGraphics.java 2010-10-07 19:50:34 UTC (rev 3823) @@ -446,7 +446,7 @@ return; if(p.getAttributes().getAppearance() == null) { - System.err.println("RrGraphics: polygon with size > 0 has null appearance."); + Debug.e("RrGraphics: polygon with size > 0 has null appearance."); return; } @@ -470,7 +470,7 @@ { if(b.attribute().getAppearance() == null) { - System.err.println("RrGraphics: booleanGrid has null appearance."); + Debug.e("RrGraphics: booleanGrid has null appearance."); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |