Skip to content

Commit

Permalink
Included jump,fast and jump,slow in U01
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarize authored Jul 22, 2018
1 parent 7145d91 commit c7ca236
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions pyembroidery/U01Reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,57 @@ def read_u01_stitches(f, out):
if (ctrl & 0x40) != 0:
dy = -dy
command = ctrl & 0b11111
#print(str(count), " ", str("{0:b}").format(ctrl), " 0x%0.2X " % ctrl, str(command), " " + str(dx), " ", str(dy))
# print(str(count), " ", str("{0:b}").format(ctrl), " 0x%0.2X " % ctrl, str(command), " " + str(dx), " ", str(dy))
if command == 0x0:
# Stitch
out.stitch(dx, dy)
continue
if command == 0x1:
if command == 0x01:
# Jump
out.move(dx, dy)
continue
if command == 0x2:
if command == 0x02:
# Fast
out.add_stitch_relative(FAST)
if dx != 0 or dy != 0:
out.stitch(dx, dy)
continue
if command == 0x4:
if command == 0x03:
# Fast, Jump
out.add_stitch_relative(FAST)
if dx != 0 or dy != 0:
out.move(dx, dy)
continue
if command == 0x04:
# Slow
out.add_stitch_relative(SLOW)
if dx != 0 or dy != 0:
out.stitch(dx, dy)
continue
if command == 0x7:
if command == 0x05:
# Slow, Jump
out.add_stitch_relative(SLOW)
if dx != 0 or dy != 0:
out.move(dx, dy)
continue
if command == 0x06:
# T1 Top Thread Trimming, TTrim.
out.trim(dx, dy)
continue
if command == 0x07:
# T2 Bobbin Threading
out.trim(dx, dy)
continue
if command == 0x8: # ww, stop file had proper A8 rather than E8 and displacement
if command == 0x08: # ww, stop file had proper A8 rather than E8 and displacement
# C00 Stop
out.stop(dx, dy)
continue
if 0xE9 <= ctrl <= 0xEF:
if 0x09 <= command <= 0x17:
# C01 - C14
if count > 1:
out.color_change(dx, dy)
continue
if ctrl == 0xF8:
if command == 0x18:
break
break # Uncaught Command
out.end()
Expand Down

0 comments on commit c7ca236

Please sign in to comment.