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)
| 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 | ''' |