MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / set_position

Method set_position

src/ext/makerbot_driver/Gcode/Parser.py:196–212  ·  view source on GitHub ↗

Explicitely sets the position of the state machine and bot to the given point

(self, codes, flags, comment)

Source from the content-addressed store, hash-verified

194 self.state.lose_position(flags)
195
196 def set_position(self, codes, flags, comment):
197 """Explicitely sets the position of the state machine and bot
198 to the given point
199 """
200 new_point = self.state.position.copy()
201 self.state.update_point_with_codes(new_point, codes, self.state.values.get('tool_index', None))
202 new_position = new_point.ToList()
203 stepped_position = makerbot_driver.Gcode.multiply_vector(
204 new_position,
205 self.state.get_axes_values('steps_per_mm')
206 )
207 try:
208 self.s3g.set_extended_position(stepped_position)
209 except Exception:
210 raise
211 else:
212 self.state.update_point_with_codes(self.state.position, codes, self.state.values.get('tool_index', None))
213
214 def wait_for_tool_ready(self, codes, flags, comment):
215 """

Callers

nothing calls this directly

Calls 6

ToListMethod · 0.80
get_axes_valuesMethod · 0.80
set_extended_positionMethod · 0.80
copyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected