diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-04-24 23:29:05 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-05-05 11:08:12 -0400 |
commit | 3e6f2206b3855d8295df16169051a3c8e7d76656 (patch) | |
tree | f380bf646508c425c965e4fd810316a997a823ba /klippy/extras | |
parent | e5c512c8d5b5e9cda885b2055d0c2b359ad35249 (diff) | |
download | kutter-3e6f2206b3855d8295df16169051a3c8e7d76656.tar.gz kutter-3e6f2206b3855d8295df16169051a3c8e7d76656.tar.xz kutter-3e6f2206b3855d8295df16169051a3c8e7d76656.zip |
hall_filament_width_sensor: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/hall_filament_width_sensor.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/klippy/extras/hall_filament_width_sensor.py b/klippy/extras/hall_filament_width_sensor.py index d95f6088..d9ddf827 100644 --- a/klippy/extras/hall_filament_width_sensor.py +++ b/klippy/extras/hall_filament_width_sensor.py @@ -127,22 +127,22 @@ class HallFilamentWidthSensor: self.filament_array = [] return eventtime + 1 - def cmd_M407(self, params): + def cmd_M407(self, gcmd): response = "" if self.lastFilamentWidthReading > 0: response += ("Filament dia (measured mm): " + str(self.diameter)) else: response += "Filament NOT present" - self.gcode.respond_info(response) + gcmd.respond_info(response) - def cmd_ClearFilamentArray(self, params): + def cmd_ClearFilamentArray(self, gcmd): self.filament_array = [] - self.gcode.respond_info("Filament width measurements cleared!") + gcmd.respond_info("Filament width measurements cleared!") # Set extrude multiplier to 100% self.gcode.run_script_from_command("M221 S100") - def cmd_M405(self, params): + def cmd_M405(self, gcmd): response = "Filament width sensor Turned On" if self.is_active: response = "Filament width sensor is already On" @@ -151,9 +151,9 @@ class HallFilamentWidthSensor: # Start extrude factor update timer self.reactor.update_timer(self.extrude_factor_update_timer, self.reactor.NOW) - self.gcode.respond_info(response) + gcmd.respond_info(response) - def cmd_M406(self, params): + def cmd_M406(self, gcmd): response = "Filament width sensor Turned Off" if not self.is_active: response = "Filament width sensor is already Off" @@ -166,16 +166,16 @@ class HallFilamentWidthSensor: self.filament_array = [] # Set extrude multiplier to 100% self.gcode.run_script_from_command("M221 S100") - self.gcode.respond_info(response) + gcmd.respond_info(response) - def cmd_Get_Raw_Values(self, params): + def cmd_Get_Raw_Values(self, gcmd): response = "ADC1=" response += (" "+str(self.lastFilamentWidthReading)) response += (" ADC2="+str(self.lastFilamentWidthReading2)) response += (" RAW="+ str(self.lastFilamentWidthReading +self.lastFilamentWidthReading2)) - self.gcode.respond_info(response) + gcmd.respond_info(response) def get_status(self, eventtime): return {'Diameter': self.diameter, 'Raw':(self.lastFilamentWidthReading+ |