Permalink
Browse files

Merged branch master into variableSubstitute

Conflicts:
	doc/gcode_protocol.markdown
  • Loading branch information...
2 parents 0fba169 + 62203ca commit 28e1e73f90272f54465c9dc4316c6a3c3e5281ca @dgs3 dgs3 committed Jun 18, 2012
@@ -1077,7 +1077,7 @@ The buffer is also displayed when the clear message flag is 1. If multiple packe
The "last message in group" flag must be used for display of multi-packet messages.
Normal popping of the message screen, such as when a print is over, is ignored if the "last message in group" flag has not been received. This is because the bot thinks it is still waiting for the remainder of a message.
-if the "clear message" flag is 1, the message buffer will be cleared and any existing timeout out will be cleared.
+if the "clear message" flag is 0, the message buffer will be cleared and any existing timeout out will be cleared.
If the "wait on button" flag is 1, the message screen will clear after a user button press is received. The timeout field is still relevant if the button press is never received.
@@ -13,6 +13,8 @@
help="s3g file to write out", default=False)
parser.add_option("-m", "--machine_type", dest="machine",
help="machine type", default="ReplicatorDual")
+parser.add_option("-s", "--gcode_start_end_sequences", dest="start_end_sequences",
+ help="run gcode start and end proceeses", default=False)
(options, args) = parser.parse_args()
@@ -27,6 +29,15 @@
parser.state.profile = profile
environment = {}
+
+if options.start_end_sequences:
+ for line in parser.state.profile.values['print_start_sequence']:
+ parser.ExecuteLine(line, environment)
+
with open(options.input_file) as f:
for line in f:
parser.ExecuteLine(line, environment)
+
+if options.start_end_sequences:
+ for line in parser.state.profile.values['print_end_sequence']:
+ parser.ExecuteLine(line, environment)
View
@@ -8,7 +8,7 @@ To connect to a machine, you will need the following module:
To run the unit tests, you will need the following modules:
-* [Mock](http://pypi.python.org/pypi/mock)
+* [Mock](http://pypi.python.org/pypi/mock) (Note: Use version 0.8 or greater)
* [unittest2](http://pypi.python.org/pypi/unittest2) (Python 2.6 and earlier)
## Example: Connecting to a Replicator
View
@@ -232,9 +232,9 @@ def DisplayMessage(self, codes, flags, comment):
"""
row = 0 # As per the gcode protocol
col = 0 # As per the gcode protocol
- clear_existing = True # As per the gcode protocol
- last_in_group = True # As per the gcode protocol
- wait_for_button = False # As per the gcode protocol
+ clear_existing = False #If false, clears the message buffer
+ last_in_group = True #If true, signifies this is the last in a group
+ wait_for_button = False #If true, signifies a button wait
self.s3g.DisplayMessage(
row,
@@ -83,7 +83,7 @@
"M104 S0 T0",
"G162 X Y D500",
"M18",
- "M70 P5 ( We <3 Making Things!)",
+ "M70 P5 (We <3 Making Things!)",
"M72 P1 ( Play Ta-Da song )",
"M18 (Turn off steppers after a build)",
"(*********end End.gcode*******)"
@@ -75,7 +75,7 @@
"M104 S0 T0",
"G162 X Y D500",
"M18",
- "M70 P5 ( We <3 Making Things!)",
+ "M70 P5 (We <3 Making Things!)",
"M72 P1 ( Play Ta-Da song )",
"M18 (Turn off steppers after a build)",
"(*********end End.gcode*******)"
@@ -3,10 +3,14 @@
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
-import s3g
-import unittest2 as unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import mock
+import s3g
+
class SingleHeadReading(unittest.TestCase):
def setUp(self):
@@ -76,7 +80,6 @@ def test_single_head_miracle_grue(self):
ExecuteFile(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'doc', 'gcode_samples', 'miracle_grue_single_extrusion.gcode'), self.p)
def ExecuteFile(theFile, parser):
- environment = {}
for line in parser.state.profile.values['print_start_sequence']:
parser.ExecuteLine(line)
with open(theFile) as f:
View
@@ -78,15 +78,20 @@ def test_disable_axes(self):
self.mock.ToggleAxes.assert_called_once_with(flags, False)
- # TODO: test for missing timeout
+ def test_display_message_missing_timeout(self):
+ codes = {}
+ flags = []
+ comment = 'asdf'
+ self.assertRaises(KeyError, self.g.DisplayMessage, codes, flags, comment)
+
def test_display_message(self):
row = 0 # As specified in the gcode protocol
col = 0 # As specified in the gcode protocol
message = 'ABCDEFG123'
timeout = 123
- clear_existing = True # As specified in the gcode protocol
- last_in_group = True # As specified in the gcode protocol
- wait_for_button = False # As specified in the gcode protocol
+ clear_existing = False
+ last_in_group = True
+ wait_for_button = False
codes = {'P' : timeout}
comment = message

0 comments on commit 28e1e73

Please sign in to comment.