def send_gcode(line): webiopi.debug("Process - " + line) #result = "HELLO\n" + do_line(line) do_line(line) g = GCode.parse_line(line) res = machine.do_command(g) result = "HELLO\n" if res is not None: result += res return "GCODE SENT: [" + line + "]" + result
def do_line(line): try: g = GCode.parse_line(line) res = machine.do_command(g) except (GCodeException, GMachineException) as e: return 'ERROR ' + str(e) if res is not None: return 'OK ' + res else: return 'OK' return True
def do_line(line): try: g = GCode.parse_line(line) res = machine.do_command(g) except (GCodeException, GMachineException) as e: print('ERROR ' + str(e)) return False if res is not None: print('OK ' + res) else: print('OK') return True
def go_1(): blink_1() g = GCode.parse_line("y10") res = machine.do_command(g)