Process this instance in a list of steps supplied by the designer to generate and return a line of gcode. Args: state (State): The state object containing printer and extruder information. Returns: str: The generated line of gcode.
(self, state)
| 26 | return s if s != '' else None |
| 27 | |
| 28 | def gcode(self, state): |
| 29 | ''' |
| 30 | Process this instance in a list of steps supplied by the designer to generate and return a line of gcode. |
| 31 | |
| 32 | Args: |
| 33 | state (State): The state object containing printer and extruder information. |
| 34 | |
| 35 | Returns: |
| 36 | str: The generated line of gcode. |
| 37 | |
| 38 | ''' |
| 39 | XYZ_str = self.XYZ_gcode(state.point) |
| 40 | if XYZ_str != None: # only write a line of gcode if movement occurs |
| 41 | G_str = 'G1 ' if state.extruder.on or state.extruder.travel_format == "G1_E0" else 'G0 ' |
| 42 | F_str = state.printer.f_gcode(state) |
| 43 | E_str = state.extruder.e_gcode(self, state) |
| 44 | gcode_str = f'{G_str}{F_str}{XYZ_str}{E_str}' |
| 45 | state.printer.speed_changed = False |
| 46 | state.point.update_from(self) |
| 47 | return gcode_str.strip() # strip the final space |
no test coverage detected