z_thermal_adjust: get_temp hotfix

M105 expects get_temp method. Module crashes when gcode_id parameter
is set and M105 called. Add methods as hotfix.

Signed-off-by: Robert Pazdzior <robertp@norbital.com>
This commit is contained in:
alchemyEngine 2022-09-29 19:44:04 +01:00 committed by KevinOConnor
parent 6288da13ac
commit a2482d4f95
1 changed files with 6 additions and 0 deletions

View File

@ -145,6 +145,12 @@ class ZThermalAdjuster:
self.measured_min = min(self.measured_min, self.smoothed_temp) self.measured_min = min(self.measured_min, self.smoothed_temp)
self.measured_max = max(self.measured_max, self.smoothed_temp) self.measured_max = max(self.measured_max, self.smoothed_temp)
def get_temp(self, eventtime):
return self.smoothed_temp, 0.
def stats(self, eventtime):
return False, '%s: temp=%.1f' % ("z_thermal_adjust", self.smoothed_temp)
def cmd_SET_Z_THERMAL_ADJUST(self, gcmd): def cmd_SET_Z_THERMAL_ADJUST(self, gcmd):
enable = gcmd.get_int('ENABLE', None, minval=0, maxval=1) enable = gcmd.get_int('ENABLE', None, minval=0, maxval=1)
coeff = gcmd.get_float('TEMP_COEFF', None, minval=-1, maxval=1) coeff = gcmd.get_float('TEMP_COEFF', None, minval=-1, maxval=1)