aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-04-24 15:54:18 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-04-24 15:54:18 -0400
commit64031ab3d7c5a857d5bdaa975752112f2da38a49 (patch)
tree9b2133ae16967a6464f44779c98120c38c99dd0d /klippy/extras
parent61524542d20e50c4866836d6ed23ca03521ffb15 (diff)
downloadkutter-64031ab3d7c5a857d5bdaa975752112f2da38a49.tar.gz
kutter-64031ab3d7c5a857d5bdaa975752112f2da38a49.tar.xz
kutter-64031ab3d7c5a857d5bdaa975752112f2da38a49.zip
gcode: Rename respond() to respond_raw()
Rename the method to make it more clear that it is a low-level call that should be rarely used. Also, change gcode_button.py, hall_filament_width_sensor.py, and tsl1401cl_filament_width_sensor.py to use respond_info() instead of respond_raw(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/bed_mesh.py6
-rw-r--r--klippy/extras/gcode_button.py2
-rw-r--r--klippy/extras/hall_filament_width_sensor.py10
-rw-r--r--klippy/extras/query_endstops.py2
-rw-r--r--klippy/extras/respond.py4
-rw-r--r--klippy/extras/tsl1401cl_filament_width_sensor.py8
-rw-r--r--klippy/extras/virtual_sdcard.py18
7 files changed, 25 insertions, 25 deletions
diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py
index f6b53f96..c2a6e390 100644
--- a/klippy/extras/bed_mesh.py
+++ b/klippy/extras/bed_mesh.py
@@ -187,7 +187,8 @@ class BedMesh:
self.gcode.respond_info("Bed has not been probed")
else:
self.bmc.print_probed_positions(self.gcode.respond_info)
- self.z_mesh.print_mesh(self.gcode.respond, self.horizontal_move_z)
+ self.z_mesh.print_mesh(self.gcode.respond_raw,
+ self.horizontal_move_z)
cmd_BED_MESH_MAP_help = "Serialize mesh and output to terminal"
def cmd_BED_MESH_MAP(self, params):
if self.z_mesh is not None:
@@ -196,8 +197,7 @@ class BedMesh:
'mesh_min': (params['min_x'], params['min_y']),
'mesh_max': (params['max_x'], params['max_y']),
'z_positions': self.bmc.probed_matrix}
- self.gcode.respond(
- "mesh_map_output " + json.dumps(outdict))
+ self.gcode.respond_raw("mesh_map_output " + json.dumps(outdict))
else:
self.gcode.respond_info("Bed has not been probed")
cmd_BED_MESH_CLEAR_help = "Clear the Mesh so no z-adjusment is made"
diff --git a/klippy/extras/gcode_button.py b/klippy/extras/gcode_button.py
index f6ec5870..757d8f7a 100644
--- a/klippy/extras/gcode_button.py
+++ b/klippy/extras/gcode_button.py
@@ -26,7 +26,7 @@ class GCodeButton:
cmd_QUERY_BUTTON_help = "Report on the state of a button"
def cmd_QUERY_BUTTON(self, params):
- self.gcode.respond(self.name + ": " + self.get_status()['state'])
+ self.gcode.respond_info(self.name + ": " + self.get_status()['state'])
def button_callback(self, eventtime, state):
self.last_state = state
diff --git a/klippy/extras/hall_filament_width_sensor.py b/klippy/extras/hall_filament_width_sensor.py
index 860ec2ca..d95f6088 100644
--- a/klippy/extras/hall_filament_width_sensor.py
+++ b/klippy/extras/hall_filament_width_sensor.py
@@ -134,11 +134,11 @@ class HallFilamentWidthSensor:
+ str(self.diameter))
else:
response += "Filament NOT present"
- self.gcode.respond(response)
+ self.gcode.respond_info(response)
def cmd_ClearFilamentArray(self, params):
self.filament_array = []
- self.gcode.respond("Filament width measurements cleared!")
+ self.gcode.respond_info("Filament width measurements cleared!")
# Set extrude multiplier to 100%
self.gcode.run_script_from_command("M221 S100")
@@ -151,7 +151,7 @@ class HallFilamentWidthSensor:
# Start extrude factor update timer
self.reactor.update_timer(self.extrude_factor_update_timer,
self.reactor.NOW)
- self.gcode.respond(response)
+ self.gcode.respond_info(response)
def cmd_M406(self, params):
response = "Filament width sensor Turned Off"
@@ -166,7 +166,7 @@ class HallFilamentWidthSensor:
self.filament_array = []
# Set extrude multiplier to 100%
self.gcode.run_script_from_command("M221 S100")
- self.gcode.respond(response)
+ self.gcode.respond_info(response)
def cmd_Get_Raw_Values(self, params):
response = "ADC1="
@@ -175,7 +175,7 @@ class HallFilamentWidthSensor:
response += (" RAW="+
str(self.lastFilamentWidthReading
+self.lastFilamentWidthReading2))
- self.gcode.respond(response)
+ self.gcode.respond_info(response)
def get_status(self, eventtime):
return {'Diameter': self.diameter,
'Raw':(self.lastFilamentWidthReading+
diff --git a/klippy/extras/query_endstops.py b/klippy/extras/query_endstops.py
index 9682228f..f4bcbd81 100644
--- a/klippy/extras/query_endstops.py
+++ b/klippy/extras/query_endstops.py
@@ -27,7 +27,7 @@ class QueryEndstops:
msg = " ".join(["%s:%s" % (name, ["open", "TRIGGERED"][not not t])
for name, t in self.last_state])
gcode = self.printer.lookup_object('gcode')
- gcode.respond(msg)
+ gcode.respond_raw(msg)
def load_config(config):
return QueryEndstops(config)
diff --git a/klippy/extras/respond.py b/klippy/extras/respond.py
index b700b5e2..745ccc7c 100644
--- a/klippy/extras/respond.py
+++ b/klippy/extras/respond.py
@@ -32,7 +32,7 @@ class HostResponder:
msg = msg[5:]
else:
msg = ''
- self.gcode.respond("%s %s" % (self.default_prefix, msg))
+ self.gcode.respond_raw("%s %s" % (self.default_prefix, msg))
def cmd_RESPOND(self, params):
respond_type = self.gcode.get_str('TYPE', params, None)
prefix = self.default_prefix
@@ -46,7 +46,7 @@ class HostResponder:
" of 'echo', 'command', or 'error'" % (respond_type,))
prefix = self.gcode.get_str('PREFIX', params, prefix)
msg = self.gcode.get_str('MSG', params, '')
- self.gcode.respond("%s %s" %(prefix, msg))
+ self.gcode.respond_raw("%s %s" %(prefix, msg))
def load_config(config):
return HostResponder(config)
diff --git a/klippy/extras/tsl1401cl_filament_width_sensor.py b/klippy/extras/tsl1401cl_filament_width_sensor.py
index c9f5ab17..b54cd9bc 100644
--- a/klippy/extras/tsl1401cl_filament_width_sensor.py
+++ b/klippy/extras/tsl1401cl_filament_width_sensor.py
@@ -110,11 +110,11 @@ class FilamentWidthSensor:
+ str(self.lastFilamentWidthReading))
else:
response += "Filament NOT present"
- self.gcode.respond(response)
+ self.gcode.respond_info(response)
def cmd_ClearFilamentArray(self, params):
self.filament_array = []
- self.gcode.respond("Filament width measurements cleared!")
+ self.gcode.respond_info("Filament width measurements cleared!")
# Set extrude multiplier to 100%
self.gcode.run_script_from_command("M221 S100")
@@ -127,7 +127,7 @@ class FilamentWidthSensor:
# Start extrude factor update timer
self.reactor.update_timer(self.extrude_factor_update_timer,
self.reactor.NOW)
- self.gcode.respond(response)
+ self.gcode.respond_info(response)
def cmd_M406(self, params):
response = "Filament width sensor Turned Off"
@@ -142,7 +142,7 @@ class FilamentWidthSensor:
self.filament_array = []
# Set extrude multiplier to 100%
self.gcode.run_script_from_command("M221 S100")
- self.gcode.respond(response)
+ self.gcode.respond_info(response)
def load_config(config):
return FilamentWidthSensor(config)
diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py
index a73d3d12..9b08842c 100644
--- a/klippy/extras/virtual_sdcard.py
+++ b/klippy/extras/virtual_sdcard.py
@@ -72,13 +72,13 @@ class VirtualSD:
def cmd_M20(self, params):
# List SD card
files = self.get_file_list()
- self.gcode.respond("Begin file list")
+ self.gcode.respond_raw("Begin file list")
for fname, fsize in files:
- self.gcode.respond("%s %d" % (fname, fsize))
- self.gcode.respond("End file list")
+ self.gcode.respond_raw("%s %d" % (fname, fsize))
+ self.gcode.respond_raw("End file list")
def cmd_M21(self, params):
# Initialize SD card
- self.gcode.respond("SD card ok")
+ self.gcode.respond_raw("SD card ok")
def cmd_M23(self, params):
# Select SD file
if self.work_timer is not None:
@@ -108,8 +108,8 @@ class VirtualSD:
except:
logging.exception("virtual_sdcard file open")
raise self.gcode.error("Unable to open file")
- self.gcode.respond("File opened:%s Size:%d" % (filename, fsize))
- self.gcode.respond("File selected")
+ self.gcode.respond_raw("File opened:%s Size:%d" % (filename, fsize))
+ self.gcode.respond_raw("File selected")
self.current_file = f
self.file_position = 0
self.file_size = fsize
@@ -132,9 +132,9 @@ class VirtualSD:
def cmd_M27(self, params):
# Report SD print status
if self.current_file is None:
- self.gcode.respond("Not SD printing.")
+ self.gcode.respond_raw("Not SD printing.")
return
- self.gcode.respond("SD printing byte %d/%d" % (
+ self.gcode.respond_raw("SD printing byte %d/%d" % (
self.file_position, self.file_size))
# Background work timer
def work_handler(self, eventtime):
@@ -162,7 +162,7 @@ class VirtualSD:
self.current_file.close()
self.current_file = None
logging.info("Finished SD card print")
- self.gcode.respond("Done printing file")
+ self.gcode.respond_raw("Done printing file")
break
lines = data.split('\n')
lines[0] = partial_input + lines[0]