예제 #1
0
파일: web.py 프로젝트: nortd/driveboardapp
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 '{}'
예제 #2
0
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 '{}'
예제 #3
0
def offset(x, y, z):
    if not driveboard.status()['ready']:
        bottle.abort(400, "Machine not ready.")
    driveboard.absoffset(x, y, z)
    return '{}'
예제 #4
0
def offsety(y):
    if not driveboard.status()['ready']:
        bottle.abort(400, "Machine not ready.")
    driveboard.offset(y=y)
    return '{}'
예제 #5
0
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())
예제 #6
0
파일: web.py 프로젝트: nortd/driveboardapp
def offset(x, y, z):
    if not driveboard.status()['ready']:
        bottle.abort(400, "Machine not ready.")
    driveboard.absoffset(x, y, z)
    return '{}'
예제 #7
0
파일: web.py 프로젝트: nortd/driveboardapp
def offsety(y):
    if not driveboard.status()['ready']:
        bottle.abort(400, "Machine not ready.")
    driveboard.offset(y=y)
    return '{}'
예제 #8
0
파일: web.py 프로젝트: nortd/driveboardapp
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())
예제 #9
0
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 '{}'
예제 #10
0
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 '{}'
예제 #11
0
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],