diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-21 17:19:43 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-08-25 19:27:05 -0400 |
commit | 268834e4aedac2e435e778802353e767d6b8abe3 (patch) | |
tree | e3970bf8774b8401d80e97e37886a45276846c33 /klippy/gcode.py | |
parent | b80c488d36fa22313616d3eacdcf3fcc284f972f (diff) | |
download | kutter-268834e4aedac2e435e778802353e767d6b8abe3.tar.gz kutter-268834e4aedac2e435e778802353e767d6b8abe3.tar.xz kutter-268834e4aedac2e435e778802353e767d6b8abe3.zip |
klippy: Store printer startup parameters in new "start_args" dictionary
Store pertinent information from the software startup in a dictionary
that the various printer components can access instead of in
individual variables in the Printer() class. This makes it easier to
add future command-line options.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index a60c1555..fafa9476 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -9,15 +9,15 @@ import homing, extruder # Parse out incoming GCode and find and translate head movements class GCodeParser: RETRY_TIME = 0.100 - def __init__(self, printer, fd, is_fileinput=False): + def __init__(self, printer, fd): self.printer = printer self.fd = fd - self.is_fileinput = is_fileinput # Input handling self.reactor = printer.reactor self.is_processing_data = False + self.is_fileinput = not not printer.get_start_args().get("debuginput") self.fd_handle = None - if not is_fileinput: + if not self.is_fileinput: self.fd_handle = self.reactor.register_fd(self.fd, self.process_data) self.partial_input = "" self.bytes_read = 0 @@ -140,8 +140,7 @@ class GCodeParser: if not data and self.is_fileinput: self.motor_heater_off() if self.toolhead is not None: - if not self.printer.mcu.is_fileoutput(): - self.toolhead.wait_moves() + self.toolhead.wait_moves() self.printer.request_exit('exit_eof') self.is_processing_data = False if self.fd_handle is None: @@ -392,8 +391,8 @@ class GCodeParser: cmd_M115_when_not_ready = True def cmd_M115(self, params): # Get Firmware Version and Capabilities - kw = {"FIRMWARE_NAME": "Klipper" - , "FIRMWARE_VERSION": self.printer.software_version} + software_version = self.printer.get_start_args().get('software_version') + kw = {"FIRMWARE_NAME": "Klipper", "FIRMWARE_VERSION": software_version} self.ack(" ".join(["%s:%s" % (k, v) for k, v in kw.items()])) def cmd_M140(self, params): # Set Bed Temperature |