diff --git a/inkscape_driver/eggbot.inx b/inkscape_driver/eggbot.inx index a1e0437e..4ba43e59 100755 --- a/inkscape_driver/eggbot.inx +++ b/inkscape_driver/eggbot.inx @@ -20,6 +20,8 @@ Need help? Visit http://wiki.evilmadscientist.com/eggbot + diff --git a/inkscape_driver/eggbot.py b/inkscape_driver/eggbot.py index 924d5a52..7f2f508a 100755 --- a/inkscape_driver/eggbot.py +++ b/inkscape_driver/eggbot.py @@ -137,6 +137,10 @@ def __init__(self): action="store", type="inkbool", dest="revEggMotor", default=False, help="Reverse motion of egg motor.") + self.OptionParser.add_option("--commandLog", + action="store", type="string", + dest="commandLog", default="", + help="Log file for drawing commands.") self.allLayers = None self.plotCurrentLayer = None @@ -202,6 +206,8 @@ def effect(self): self.serialPort = ebb_serial.openPort() if self.serialPort is None: inkex.errormsg(gettext.gettext("Failed to connect to EggBot. :(")) + if len(self.options.commandLog) > 0: + ebb_serial.startLogging(self.options.commandLog) if self.options.tab == "splash": self.allLayers = True @@ -252,6 +258,9 @@ def effect(self): ebb_motion.doTimedPause(self.serialPort, 10) # Pause a moment for underway commands to finish... ebb_serial.closePort(self.serialPort) + if len(self.options.commandLog) > 0: + ebb_serial.stopLogging() + self.svgDataRead = False self.UpdateSVGEggbotData(self.svg) return