extruder: expose `can_extrude` flag based on temperature

Sometimes an automated filament load is implemented,
but extruder might not always extrude filament.

This adds a flag to check if this operation is possible.

Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
This commit is contained in:
Kamil Trzcinski 2021-06-08 10:39:55 +00:00 committed by KevinOConnor
parent 6dcb902d89
commit d2c2aaf55d
2 changed files with 3 additions and 0 deletions

View File

@ -144,6 +144,8 @@ The following information is available for heater objects such as
the given heater. the given heater.
- `power`: The last setting of the PWM pin (a value between 0.0 and - `power`: The last setting of the PWM pin (a value between 0.0 and
1.0) associated with the heater. 1.0) associated with the heater.
- `can_extrude`: If extruder can extrude (defined by `min_extrude_temp`),
available only for [extruder](Config_Reference.md#extruder)
# heaters # heaters

View File

@ -91,6 +91,7 @@ class PrinterExtruder:
self.pressure_advance_smooth_time = smooth_time self.pressure_advance_smooth_time = smooth_time
def get_status(self, eventtime): def get_status(self, eventtime):
return dict(self.heater.get_status(eventtime), return dict(self.heater.get_status(eventtime),
can_extrude=self.heater.can_extrude,
pressure_advance=self.pressure_advance, pressure_advance=self.pressure_advance,
smooth_time=self.pressure_advance_smooth_time) smooth_time=self.pressure_advance_smooth_time)
def get_name(self): def get_name(self):