Skip to content

Commit

Permalink
Not it finds the regstration marks, but print the page rotated by 90°
Browse files Browse the repository at this point in the history
  • Loading branch information
skruppy committed Mar 29, 2016
1 parent a2ec7cb commit 64e7ecc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions sendto_silhouette.inx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
<param name="regmark_help" type="description">???</param>
<param name="regsearch" type="boolean" _gui-text="Search for the regitration marks">false</param>
<param name="regsearch_help" type="description">???</param>
<param name="regwidth" type="float" min="0.0" _gui-text="X mark distance [mm]">180.0</param>
<param name="reglength" type="float" min="0.0" _gui-text="Y mark distance [mm]">230.0</param>
<param name="regwidth" type="float" min="0.0" max="10000" _gui-text="X mark distance [mm]">180</param>
<param name="reglength" type="float" min="0.0" max="10000" _gui-text="Y mark distance [mm]">230</param>
<param name="regdistance_help" type="description">Distance of the registration mark edges</param>
</page>

Expand Down
19 changes: 11 additions & 8 deletions silhouette/Graphtec.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,32 +675,35 @@ def plot(s, mediawidth=210.0, mediaheight=297.0, margintop=None,
offset = (offset, 0)

s.write("FU%d,%d\x03" % (height-top, width-left))
s.write("FM1\x03") # // ?
s.write("FN0\x03") # // ?
if regmark:
s.write("TB50,381\x03") #only with registration (it was TB50,1) ???
s.write("TB50,0\x03") #only with registration (it was TB50,1) ???
s.write("TB99\x03")
s.write("TB52,2\x03")
s.write("TB51,400\x03")
s.write("TB53,10\x03")
s.write("TB55,1\x03")

if regsearch:
cmd="123"
else:
cmd="23"
## registration mark test /1-2: 180.0mm / 1-3: 230.0mm (origin 15mmx20mm)
s.write("TB%s,%i,%i\x03" % (cmd, regwidth * 20.0, reglength * 20.0))
s.write("TB%s,%i,%i,118,18\x03" % (cmd, regwidth * 20.0, reglength * 20.0))

s.write("FQ5\x03") ## only with registration ???
resp = s.read(timeout=40000) ## Allow 20s for reply...
if resp != " 0, 0\x03":
raise ValueError("Couldn't find registration marks.")
if resp != " 0\x03":
raise ValueError("Couldn't find registration marks. %s" % str(resp))

## Looks like if the reg marks work it gets 3 messages back (if it fails it times out because it only gets the first message)
resp = s.read(timeout=40000) ## Allow 20s for reply...
if resp != " 0\x03":
raise ValueError("Couldn't find registration marks.")

resp = s.read(timeout=40000) ## Allow 20s for reply...
if resp != " 1\x03":
raise ValueError("Couldn't find registration marks.")
#resp = s.read(timeout=40000) ## Allow 20s for reply...
#if resp != " 1\x03":
#raise ValueError("Couldn't find registration marks.")
else:
s.write("TB50,1\x03") # ???

Expand Down

0 comments on commit 64e7ecc

Please sign in to comment.