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

Method f_gcode

fullcontrol/gcode/printer.py:19–32  ·  view source on GitHub ↗

Generate the G-code for the feedrate (F) based on the current state. Parameters: - state: The current state of the printer. Returns: - The G-code string for the feedrate (F) based on the current state.

(self, state)

Source from the content-addressed store, hash-verified

17 speed_changed: Optional[bool] = None
18
19 def f_gcode(self, state):
20 """
21 Generate the G-code for the feedrate (F) based on the current state.
22
23 Parameters:
24 - state: The current state of the printer.
25
26 Returns:
27 - The G-code string for the feedrate (F) based on the current state.
28 """
29 if self.speed_changed == True:
30 return f'F{self.print_speed if state.extruder.on else self.travel_speed:.1f}'.rstrip('0').rstrip('.') + ' '
31 else:
32 return ''
33
34 def gcode(self, state):
35 '''

Callers 1

gcodeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected