def run(jobname): """Send job from queue to the machine.""" job = _get(jobname) if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.job(json.loads(job)) return '{}'
def run(jobname): """Send job from queue to the machine.""" job = _get(jobname) if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.job(json.loads(job)) return '{}'
def offset(x, y, z): if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.absoffset(x, y, z) return '{}'
def offsety(y): if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.offset(y=y) return '{}'
def status(): global time_status_last if not driveboard.connected() and (time.time() - time_status_last) > 6.0: driveboard.connect_withfind(verbose=False) time_status_last = time.time() return json.dumps(driveboard.status())
def offset(x, y, z): if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.absoffset(x, y, z) return '{}'
def offsety(y): if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.offset(y=y) return '{}'
def status(): global time_status_last if not driveboard.connected() and (time.time()-time_status_last) > 6.0: driveboard.connect_withfind(verbose=False) time_status_last = time.time() return json.dumps(driveboard.status())
def clear_offset(): if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.def_offset_custom(0,0,0) driveboard.sel_offset_table() return '{}'
def offset(x, y, z): if not driveboard.status()['ready']: bottle.abort(400, "Machine not ready.") driveboard.def_offset_custom(x, y, z) driveboard.sel_offset_custom() return '{}'
import driveboard, time import sys # build up connection driveboard.connect() # print driveboard.status() # # driveboard.jobfile("../library/lines.dba") # while not driveboard.status()['ready']: # time.sleep(1) # print str(driveboard.status()['progress']*100) + '%' # sys.stdout.write('.') print driveboard.status() path = [[[0, 0], [0, 0]], [[118.032, 8.486], [116.43, 8.641], [113.708, 9.719], [111.841, 11.177], [110.933, 12.172], [110.096, 13.547], [108.931, 17.198], [108.037, 21.231], [106.926, 24.67], [106.135, 25.86], [105.149, 26.732], [102.655, 27.988], [99.453, 28.569], [95.53, 28.449],