From: <bu...@us...> - 2010-11-21 04:55:27
|
Revision: 3895 http://reprap.svn.sourceforge.net/reprap/?rev=3895&view=rev Author: buzz Date: 2010-11-21 04:55:21 +0000 (Sun, 21 Nov 2010) Log Message: ----------- Added support for non-fatal messages and line-continuations from the Firmware, which are useful when debugging which cant always follow the current protocol. The "comment" format is C++ like, with double slashes at the start of the line meaning "ignore to end of line". // this is a comment I also added support for breaking up mesages across multiple lines while pretending that you didn't. Adding a single backslash character immediately before an EOL will cause the host to pretend that that EOL didn't exist, and keep reading from the next line. This commit is the Host implementation. Previous commit was the Firmware implementation. Modified Paths: -------------- trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java trunk/software/host/src/org/reprap/machines/GCodeRepRap.java Modified: trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java =================================================================== --- trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2010-11-21 04:53:17 UTC (rev 3894) +++ trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2010-11-21 04:55:21 UTC (rev 3895) @@ -734,6 +734,17 @@ { result = shutDown; Debug.e("GCodeWriter.waitForResponse(): RepRap hard fault! RepRap said: " + resp); + + } else if (resp.startsWith("//")) // immediate DEBUG "comment" from the firmware ( like C++ ) + { + Debug.d("GCodeWriter.waitForResponse(): " + resp); + resp = ""; + goAgain = true; + } else if (resp.endsWith("\\")) // lines ending in a single backslash are considered "continued" to the next line, like "C" + { + // Debug.d("GCodeWriter.waitForResponse(): " + resp); + // resp = ""; don't clear the previuos response... + goAgain = true; // but do "go again" } else if (resp.startsWith("rs")) // Re-send request? { lns = resp.substring(3); Modified: trunk/software/host/src/org/reprap/machines/GCodeRepRap.java =================================================================== --- trunk/software/host/src/org/reprap/machines/GCodeRepRap.java 2010-11-21 04:53:17 UTC (rev 3894) +++ trunk/software/host/src/org/reprap/machines/GCodeRepRap.java 2010-11-21 04:55:21 UTC (rev 3895) @@ -44,7 +44,9 @@ gcode = new GCodeReaderAndWriter(); gcode.queue("M110 ; Reset the line numbers"); gcode.queue("M115 ; Get the firmware version numbers etc"); - Debug.d("Firmware configuration string: " + gcode.lastResponse()); + String FirmwareConfig = gcode.lastResponse(); + FirmwareConfig = FirmwareConfig.replace('\\','\n'); //make it easier to read for humans if it has "continuations" + Debug.d("Firmware configuration string: " + FirmwareConfig); loadExtruders(); forceSelection = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |