#  'dump/rounded_star.dump',
#  'dump/star_man.dump'
]

doing = {}
cy_off = 0

while True:
  txt = time.strftime('%H:%M')	# '%H:%M:%S'
  print(txt)
  x = 0
  clock_path = []
  for ch in txt:
    for poly in clock_chars[ch][0]: clock_path.append(translate_poly(poly, -x,0, cscale))
    x += clock_chars[ch][1]*cscale
  cbox = dev.find_bbox(clock_path)
  ystep = cbox['lly']-cbox['ury']

  clock_path_origin = []
  for poly in clock_path: clock_path_origin.append(translate_poly(poly, -cbox['llx'], -cbox['ury']+cy_off))
  clock_path_origin.append([(0,tmp_fwd+cy_off),(0,tmp_fwd+cy_off)])
  meta = dev.plot(pathlist=clock_path_origin, offset=(0,0), no_trailer=True)
  dev.wait_for_ready()
  time.sleep(2)	# show the time before doing something else.
  cy_off += int(ystep*1.2)

  if 'cmd_idx' in doing:
    ret_cmd = doing['cmds'][doing['cmd_idx']]+','
    # we want to repeat the last draw command as a move command when returning.
    if ret_cmd[0] == 'D': ret_cmd = 'M'+ret_cmd[1:]
    dev.write(ret_cmd)
Example #2
0
    #  'dump/star_man.dump'
]

doing = {}
cy_off = 0

while True:
    txt = time.strftime('%H:%M')  # '%H:%M:%S'
    print(txt)
    x = 0
    clock_path = []
    for ch in txt:
        for poly in clock_chars[ch][0]:
            clock_path.append(translate_poly(poly, -x, 0, cscale))
        x += clock_chars[ch][1] * cscale
    cbox = dev.find_bbox(clock_path)
    ystep = cbox['lly'] - cbox['ury']

    clock_path_origin = []
    for poly in clock_path:
        clock_path_origin.append(
            translate_poly(poly, -cbox['llx'], -cbox['ury'] + cy_off))
    clock_path_origin.append([(0, tmp_fwd + cy_off), (0, tmp_fwd + cy_off)])
    meta = dev.plot(pathlist=clock_path_origin, offset=(0, 0), no_trailer=True)
    dev.wait_for_ready()
    time.sleep(2)  # show the time before doing something else.
    cy_off += int(ystep * 1.2)

    if 'cmd_idx' in doing:
        ret_cmd = doing['cmds'][doing['cmd_idx']] + ','
        # we want to repeat the last draw command as a move command when returning.