MCPcopy Create free account
hub / github.com/FullControlXYZ/fullcontrol / gcode

Method gcode

lab/fullcontrol/multiaxis/gcode/XYZBC/point.py:68–80  ·  view source on GitHub ↗

process this instance in a list of steps supplied by the designer to generate and return a line of gcode

(self, state)

Source from the content-addressed store, hash-verified

66 return system_point
67
68 def gcode(self, state):
69 'process this instance in a list of steps supplied by the designer to generate and return a line of gcode'
70 self_systemXYZ = self.inverse_kinematics(state)
71 XYZBC_str = self.XYZBC_gcode(self_systemXYZ, state.point_systemXYZ)
72 if XYZBC_str != None: # only write a line of gcode if movement occurs
73 G_str = 'G1 ' if state.extruder.on else 'G0 '
74 F_str = state.printer.f_gcode(state)
75 E_str = state.extruder.e_gcode(self, state)
76 gcode_str = f'{G_str}{F_str}{XYZBC_str}{E_str}'
77 state.printer.speed_changed = False
78 state.point.update_from(self)
79 state.point_systemXYZ.update_from(self_systemXYZ)
80 return gcode_str.strip() # strip the final space

Callers 1

gcodeFunction · 0.45

Calls 5

inverse_kinematicsMethod · 0.95
XYZBC_gcodeMethod · 0.95
e_gcodeMethod · 0.80
update_fromMethod · 0.80
f_gcodeMethod · 0.45

Tested by

no test coverage detected