Park fix?
This commit is contained in:
parent
d58abf161f
commit
777920a456
1 changed files with 7 additions and 3 deletions
|
@ -43,7 +43,7 @@ class Plotter:
|
||||||
if not connected:
|
if not connected:
|
||||||
raise Exception("Cannot connect to Axidraw")
|
raise Exception("Cannot connect to Axidraw")
|
||||||
|
|
||||||
self.ad.options.units = 1 # set to use centimeters instead of inches
|
# self.ad.options.units = 1 # set to use centimeters instead of inches
|
||||||
self.ad.options.accel = 100;
|
self.ad.options.accel = 100;
|
||||||
self.ad.options.speed_penup = 100
|
self.ad.options.speed_penup = 100
|
||||||
self.ad.options.speed_pendown = 100
|
self.ad.options.speed_pendown = 100
|
||||||
|
@ -94,6 +94,10 @@ class Plotter:
|
||||||
coordinates.append(coordinate)
|
coordinates.append(coordinate)
|
||||||
self.logger.debug(f"Plot: {coordinates}")
|
self.logger.debug(f"Plot: {coordinates}")
|
||||||
if self.ad:
|
if self.ad:
|
||||||
|
if len(coordinates) < 2:
|
||||||
|
self.info("Plot single point (park?)")
|
||||||
|
self.ad.moveto(coordinates[0][0], coordinates[0][1])
|
||||||
|
else:
|
||||||
self.ad.plan_trajectory(coordinates)
|
self.ad.plan_trajectory(coordinates)
|
||||||
# self.ad.moveto(move[0]* plotterWidth, move[1]*plotterHeight)
|
# self.ad.moveto(move[0]* plotterWidth, move[1]*plotterHeight)
|
||||||
# self.logger.debug(f'handler! {move}')
|
# self.logger.debug(f'handler! {move}')
|
||||||
|
@ -128,7 +132,7 @@ class Plotter:
|
||||||
|
|
||||||
# change of pen state? draw previous segments!
|
# change of pen state? draw previous segments!
|
||||||
if (segment[2] == 1 and not self.pen_down) or (segment[2] == 0 and self.pen_down) or len(segments) > 150:
|
if (segment[2] == 1 and not self.pen_down) or (segment[2] == 0 and self.pen_down) or len(segments) > 150:
|
||||||
if len(segments) > 1:
|
if len(segments):
|
||||||
self.draw_segments(segments)
|
self.draw_segments(segments)
|
||||||
plotterRan = True
|
plotterRan = True
|
||||||
segments = [] #reset
|
segments = [] #reset
|
||||||
|
|
Loading…
Reference in a new issue