diff --git a/docs/stereotech/quide_error_list.txt b/docs/stereotech/quide_error_list.txt new file mode 100644 index 000000000000..4d8a665541bb --- /dev/null +++ b/docs/stereotech/quide_error_list.txt @@ -0,0 +1,270 @@ +Код ошибки состоит из 3х частей, ABC: + A: к какой области относится ошибка, диапазон: 0-6 + B: статус ошибки error/warning, диапазон: 0-1 + C: индификатор ошибки + Пр: + 2020: 2-область калибровки; 0-error; 20-Mesh Leveling: Error splitting move + +config: + 001: Unable to open config file %s" % (filename,) + 002: Unable to parse option '%s' in section '%s' + 002: Option '%s' in section '%s' must have minimum of %s" + 002: Option '%s' in section '%s' must have maximum of %s" + 002: Option '%s' in section '%s' must be above %s + 002: Option '%s' in section '%s' must be below %s + 003: Choice '%s' for option '%s' in section '%s' is not a valid choice" + 004: Option '%s' in section '%s' must be specified" + 005: Include file '%s' does not exist" + 006: Recursive include of config file '%s'" % (filename) + 007: Section '%s' is not a valid config section" + 008: Option '%s' is not valid in section '%s'" + 009: Printer object skew_corection already created" + 0010: Unknown config object skew_corection_second." + 0011: Unable to load module math_2 + 0011: Unable to load module skew_corection_2 + 0012: gcode command %s already registered" % (cmd,) + 0013: mux command %s %s %s may have only one key (%s)" + 0014: mux command %s %s %s already registered (%s)" + 0015: Error loading kinematics ' + 0016: Error loading template '%s': %s + 0017: Error evaluating '%s': %s + 0018: A primary [display] section must be defined in printer.cfg to use auxilary displays + 0019: Section name [display display] is not valid. Please choose a different postfix. + 0020: Existing command '%s' not found in gcode_macro rename + +печать/кинематика/движение: + 101: Error loading kinematics + 102: G-Code move transform already specified + 103: Invalid speed in '%s' + 104: Unable to parse move '%s' + 105: Unknown g-code state: %s + 106: Printer not ready + 107: Invalid speed in '%s' + 108: Unable to parse move '%s' + 109: Must home X and Y axes first + 1010: homing_override and safe_z_homing cannot be used simultaneously + 1011: virtual_sdcard get_file_list + 1012: SD write not supported + 1013: SDCARD_RESET_FILE cannot be run from the sdcard + 1014: SD busy + 1015: SD busy + 1016: Unable to open file + 1017: SD busy + 1018: SD busy + 1019: Must home axis first + +калибровка: + 201: axis x=310 out of range (0 - 300) + 202: axis y=310 out of range (0 - 300) + 203: axis z=310 out of range (0 - 300) + 204: tool length not enough for calculate wcs_2_y! + 205: Error, tool length not enough! + 205: Error, tool length or radius not enough! + 206: auto_wcs: improperly formatted entry for point\n%s + 207: a_axis_offset: improperly formatted entry for point\n%s + 208: auto_wcs: improperly formatted entry for point\n%s + 209: b_axis_compensation: improperly formatted entry for point + #bed_mesh + 2010: bed_mesh: malformed '%s' value: %s" + 2011: Option '%s' in section bed_mesh must have a minimum of %s" + 2012: Option '%s' in section bed_mesh must have a maximum of %s + 2013: Unable to parse parameter '%s' + 2014: Unable to parse parameter ' + 2015: Parameter '%s + 2016: Parameter '%s' must have a maximum of + 2017: Unable to parse parameter '%s' + 2018: bed_mesh: ERROR, fade_target lies outside of mesh z range\nmin: %.4f, max: %.4f, fade_target: %.4f" + 2019: bed_mesh: Mesh extends outside of the fade range, please see the fade_start and fade_end options in example-extras.cfg. fade distance: %.2f mesh min: %.4f mesh max: %.4f" + 2020: Mesh Leveling: Error splitting move + 2021: bed_mesh: min/max points too close together + 2022: bed_mesh: Unable to generate coordinates for faulty region at index: %d + 2023: bed_mesh: probe_count must be odd for round beds + 2024: bed_mesh: invalid min/max points + 2025: bed_mesh: Existing faulty_region_%d %s overlaps added faulty_region_%d %s + 2026: bed_mesh: Added faulty_region_%d %s overlaps existing faulty_region_%d %s + 2027: bed_mesh: Unknown algorithm <%s> + 2028: bed_mesh: cannot exceed a probe_count of 6 when using lagrange interpolation. Configured Probe Count: %d, %d" + 2029: bed_mesh: invalid probe_count option when using bicubic interpolation. Combination of 3 points on one axis with more than 6 on another is not permitted. Configured Probe Count: %d, %d" + 2030: bed_mesh: bicubic interpolation with a probe_count of less than 4 points detected. Forcing lagrange interpolation. Configured Probe Count: %d, %d + 2031: Value for parameter 'PROFILE' must be specified + 2032: a_axis_offset: improperly formatted entry for point\n%s + # probe + 2033: Probe virtual endstop only useful as endstop pin + 2034: Can not pullup/invert probe virtual endstop + 2035: Must home before probe + 2036: Timeout during endstop homing + 2037: Probe samples exceed samples_tolerance + 2038: Toolhead moved during probe activate_gcode script + 2039: Toolhead moved during probe deactivate_gcode script + 2040: Need at least %d probe points for %s + 2041: horizontal_move_z can't be less than probe's z_offset + 2042: skew_corection: improperly formatted entry for point\n%s + 2043: Error! Factor name %s not in list factors['XY', 'XZ', 'YZ'] + 2044: skew_correction: improperly formatted entry for plane [%s]\n%s + +перефирия(mcu): + 301: Timeout on wait for '%s' response + 302: Error send cmd to mcu + 303: Multi-mcu homing not supported on multi-mcu shared axis" + 304: проблемы связанные с пинами + 305: Pin '%s' is not a valid pin name on mcu '%s' + 306: Stepper dir pin must be on same mcu as step pin + 307: Internal error in stepcompress + 308: Internal error in stepcompress + 309: Internal error in stepcompress + 3010: Internal error in stepcompress + 3011: full_steps_per_rotation invalid in section + 3012: PWM cycle time too large + 3013: MCU '%s' CRC does not match config" + 3014: MCU '%s' error during config: %s + 3015: Unable to configure MCU '%s'" + 3016: Failed automated reset of MCU '%s' + 3017: Too few moves available on MCU '%s' + 3018: проблемы с индификацией mcu(serialhdl) + 3020: Internal error in MCU stm22 stepcompress" + 3021: position_endstop in section '%s' must be between position_min and position_max + 3022: Unable to infer homing_positive_dir in section ' + 3023: Invalid homing_positive_dir / position_endstop in '%s' + 3024: Pinter rail %s shared endstop pin %s must specify the same pullup/invert settings + 3025: Must specify %s on mcu '%s'" + 3026: Unknown %s '%s'" + 3027: %s: spi pins must be on same mcu" + 3028: Pin %s must be on mcu %s + 3029: button pins must be on same mcu + 3030: %d steps per detent not supported + 3031: Duplicate canbus_uuid + 3032: Unknown canbus_uuid + 3033: One or more of these steppers are unknown: %s (valid steppers are: %s) + 3034: Stepper %s phase unknown + 3035: Invalid trigger_phase '%s' + 3036: Endstop for %s is not accurate enough for stepper phase adjustment + 3037: Endstop %s incorrect phase (got %d vs %d) + 3038: Stats not available for stepper %s + 3039: Requested temperature (%.1f) out of range (%.1f:%.1f) + 3040: Cannot load config '%s' + 3041: Heater %s already registered + 3042: Unknown heater + 3043: G-Code sensor id %s already registered + 3044: Unknown temperature sensor ' + 3045: Error on 'TEMPERATURE_WAIT': missing MINIMUM or MAXIMUM. + 3046: Unknown sensor '%s' + 3047: error homing_move_end + 3048: Endstop %s still triggered after retract + 3049: Homing failed due to printer shutdown + 3050: Probing failed due to printer shutdown + 3051: Probe triggered prior to movement + 3052: Homing failed due to printer shutdown + 3053: Invalid pin value + 3054: error pid_calibrate + 3055: pid_calibrate interrupted + 3056: Unknown stepper '%s' + 3057: Requested min speed (%.1f) is greater than max speed (%.1f) + 3058: Requested temperature (%.1f) out of range (%.1f:%.1f) + 3059: Requested min speed (%.1f) out of range (0.0 : 1.0) + 3060: Requested max speed (%.1f) out of range (0.0 : 1.0) + 3061: Unable to open temperature file '%s' + 3062: MCU temperature not supported on %s + # tmc UART + 3063: TMC mux pins must be on the same mcu + 3064: All TMC mux instances must use identical pins + 3065: Shared TMC uarts must use the same pins + 3066: Shared TMC uarts need unique address or select_pins polarity + 3067: TMC uart rx and tx pins must be on the same mcu + 3068: Unable to read tmc uart '%s' register %s + 3069: Unable to write tmc uart '%s' register %s + # tmc CAN + 3070: TMC '%s' reports error: %s + 3071: Unknown field name '%s' + 3072: VELOCITY parameter not supported by this driver + 3073: Specify either VALUE or VELOCITY + 3074: Unknown register name '%s' + 3075: tmc virtual endstop only useful as endstop + 3076: Can not pullup/invert tmc virtual pin + 3077: tmc virtual endstop requires diag pin config + 3078: Could not find config section '[%s]' required by tmc driver + 3079: TMC SPI chain must have same length + 3080: TMC SPI chain can not have duplicate position + 3081: Unable to write tmc spi '%s' register %s + +датчик филамента: + 401: Filament error on Extruder0 + 411: The filament has run out or there is a problem with its supply at the Extruder0. + 412: Recover extrusion by offset %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made + 413: Switch to second extruder and resume printing. + 414: All attempt to extrude failed. + 415: Recover extrusion after cooling and heating. + 416: Recover extrusion do extrude attempt %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 417: Extruding attempt completed successfully, resuming printing. + +диагностика: + 501: 3D module disabled, cannot set temperature for heater 'heater_bed + 502: Extruder extruder3 not connected. + +экструдер: + 601: '%s' is not a valid extruder. + 602: Active extruder does not have a stepper + 603: Unable to infer active extruder stepper + 604: Rotation distance can not be zero + 605: Extrude below minimum temp\n See the 'min_extrude_temp' config option for details + 606: Extrude only move too long (%.3fmm vs %.3fmm)\n See the 'max_extrude_only_distance' config option for details + 607: Move exceeds maximum extrusion (%.3fmm^2 vs %.3fmm^2)\n See the 'max_extrude_cross_section' config option for details + 608: Extruder not configured + 609: Extrude when no extruder present + 6010: Extruder not configured + 6011: Extruder not configured + 611: Extruder not hot enough. + +ethernet/client: + 701: Not a top-level dictionary + 702: Invalid request type + 703: Missing Argument [%s] + 704: Invalid Argument Type [%s] + 705: Multiple calls to send not allowed + 706: webhooks: Unable to delete socket file + 707: Path already registered to an endpoint + 708: mux endpoint %s %s %s may have only one key (%s) + 709: mux endpoint %s %s %s already registered (%s) + 7010: The value '%s' is not valid for %s" + 7011: webhooks: No registered callback for path '%s' + 7012: Remote method '%s' not registered" + 7013: No active connections for method '%s + 7014: Invalid argument + 7015: Invalid argument + +остальное: + 802: Error in coordinate descent: %s + # msgproto Protocol definitions for firmware communication + 806: Unable to extract params from: + 806: Unable to encode: + 806: Error during identify: + 806: Unknown value '%s' in enumeration + #Serial port management for firmware communication(serialhdl.py ) + 807: failure communication whis mcu + 808: Unable to obtain '%s' response + + 813: Printer not homed + 814: Printer not homed + 815: Printer not homed. + +gcode/gcode cmd: + 901: Internal error on command: + 902: Malformed command + 903: Error on '%s': unable to parse %s" + 903: Error on '%s': %s must have minimum of %s + 903: Error on '%s': %s must have maximum of %s" + 903: Error on '%s': %s must be above %s" + 903: Error on '%s': %s must be below %s" + 904: %s" % self.printer.get_state_message()[0] - printer is not ready for run this cmd + 905: The value '%s' is not valid for %s" + 906: Klipper state: Not ready + 907: SAVE_CONFIG section '%s' option '%s' conflicts with included value" + 908: Unable to parse existing config on SAVE_CONFIG + 909: Unable to write config file during SAVE_CONFIG + 9010: Unknown stepper %s + 9011: %s" % str(e) + 9012: Unable to parse existing variable file + 9013: Unable to parse '%s' as a literal + 9014: Unable to save variable + 9015: Internal error on command:"%s", origline"%s" + + 911: Unknown command: diff --git a/klippy/configfile.py b/klippy/configfile.py index dd32d47fd3c6..8d6c39681565 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -29,28 +29,28 @@ def _get_wrapper(self, parser, option, default, minval=None, maxval=None, acc_id = (self.section.lower(), option.lower()) self.access_tracking[acc_id] = default return default - raise error("Option '%s' in section '%s' must be specified" + raise error("001: Option '%s' in section '%s' must be specified" % (option, self.section)) try: v = parser(self.section, option) except self.error as e: raise except: - raise error("Unable to parse option '%s' in section '%s'" + raise error("002: Unable to parse option '%s' in section '%s'" % (option, self.section)) if note_valid: self.access_tracking[(self.section.lower(), option.lower())] = v if minval is not None and v < minval: - raise error("Option '%s' in section '%s' must have minimum of %s" + raise error("002: Option '%s' in section '%s' must have minimum of %s" % (option, self.section, minval)) if maxval is not None and v > maxval: - raise error("Option '%s' in section '%s' must have maximum of %s" + raise error("002: Option '%s' in section '%s' must have maximum of %s" % (option, self.section, maxval)) if above is not None and v <= above: - raise error("Option '%s' in section '%s' must be above %s" + raise error("002: Option '%s' in section '%s' must be above %s" % (option, self.section, above)) if below is not None and v >= below: - raise self.error("Option '%s' in section '%s' must be below %s" + raise self.error("002: Option '%s' in section '%s' must be below %s" % (option, self.section, below)) return v def get(self, option, default=sentinel, note_valid=True): @@ -74,7 +74,7 @@ def getchoice(self, option, choices, default=sentinel, note_valid=True): else: c = self.get(option, default, note_valid=note_valid) if c not in choices: - raise error("Choice '%s' for option '%s' in section '%s'" + raise error("003: Choice '%s' for option '%s' in section '%s'" " is not a valid choice" % (c, option, self.section)) return choices[c] def getlists(self, option, default=sentinel, seps=(',',), count=None, @@ -90,7 +90,7 @@ def lparser(value, pos): return tuple([lparser(p, pos - 1) for p in parts if p]) res = [parser(p) for p in parts] if count is not None and len(res) != count: - raise error("Option '%s' in section '%s' must have %d elements" + raise error("004: Option '%s' in section '%s' must have %d elements" % (option, self.section, count)) return tuple(res) def fcparser(section, option): @@ -159,7 +159,7 @@ def _read_config_file(self, filename): data = f.read() f.close() except: - msg = "Unable to open config file %s" % (filename,) + msg = "001: Unable to open config file %s" % (filename,) logging.exception(msg) raise error(msg) return data.replace('\r\n', '\n') @@ -226,7 +226,7 @@ def _resolve_include(self, source_filename, include_spec, fileconfig, include_filenames = glob.glob(include_glob) if not include_filenames and not glob.has_magic(include_glob): # Empty set is OK if wildcard but not for direct file reference - raise error("Include file '%s' does not exist" % (include_glob,)) + raise error("005: Include file '%s' does not exist" % (include_glob,)) include_filenames.sort() for include_filename in include_filenames: include_data = self._read_config_file(include_filename) @@ -236,7 +236,7 @@ def _resolve_include(self, source_filename, include_spec, fileconfig, def _parse_config(self, data, filename, fileconfig, visited): path = os.path.abspath(filename) if path in visited: - raise error("Recursive include of config file '%s'" % (filename)) + raise error("006: Recursive include of config file '%s'" % (filename)) visited.add(path) lines = data.split('\n') # Buffer lines between includes and parse as a unit so that overrides @@ -296,12 +296,12 @@ def check_unused_options(self, config): for section_name in fileconfig.sections(): section = section_name.lower() if section not in valid_sections and section not in objects: - raise error("Section '%s' is not a valid config section" + raise error("007: Section '%s' is not a valid config section" % (section,)) for option in fileconfig.options(section_name): option = option.lower() if (section, option) not in access_tracking: - raise error("Option '%s' is not valid in section '%s'" + raise error("008: Option '%s' is not valid in section '%s'" % (option, section)) # Setup get_status() self._build_status(config) @@ -371,7 +371,7 @@ def _disallow_include_conflicts(self, regular_data, cfgname, gcode): for section in self.autosave.fileconfig.sections(): for option in self.autosave.fileconfig.options(section): if config.fileconfig.has_option(section, option): - msg = ("SAVE_CONFIG section '%s' option '%s' conflicts " + msg = ("907: SAVE_CONFIG section '%s' option '%s' conflicts " "with included value" % (section, option)) raise gcode.error(msg) cmd_SAVE_CONFIG_help = "Overwrite config file and restart" @@ -393,7 +393,7 @@ def cmd_SAVE_CONFIG(self, gcmd): regular_data, old_autosave_data = self._find_autosave_data(data) config = self._build_config_wrapper(regular_data, cfgname) except error as e: - msg = "Unable to parse existing config on SAVE_CONFIG" + msg = "908: Unable to parse existing config on SAVE_CONFIG" logging.exception(msg) raise gcode.error(msg) regular_data = self._strip_duplicates(regular_data, self.autosave) @@ -416,7 +416,7 @@ def cmd_SAVE_CONFIG(self, gcmd): os.rename(cfgname, backup_name) os.rename(temp_name, cfgname) except: - msg = "Unable to write config file during SAVE_CONFIG" + msg = "909: Unable to write config file during SAVE_CONFIG" logging.exception(msg) raise gcode.error(msg) # Request a restart diff --git a/klippy/extras/a_axis_offset.py b/klippy/extras/a_axis_offset.py index ac5c5f9e7cab..ca8f5524fb7d 100644 --- a/klippy/extras/a_axis_offset.py +++ b/klippy/extras/a_axis_offset.py @@ -33,7 +33,7 @@ def cmd_SAVE_A_AXIS_POINT(self, gcmd): raise Exception except Exception: raise gcmd.error( - "a_axis_offset: improperly formatted entry for " + "207: a_axis_offset: improperly formatted entry for " "point\n%s" % (gcmd.get_commandline())) for axis, coord in enumerate(coords): self.point_coords[point_idx][axis] = coord diff --git a/klippy/extras/auto_wcs.py b/klippy/extras/auto_wcs.py index f306ec2834f7..d0a2187b15a8 100644 --- a/klippy/extras/auto_wcs.py +++ b/klippy/extras/auto_wcs.py @@ -210,7 +210,7 @@ def cmd_SAVE_WCS_CALC_POINT(self, gcmd): raise Exception except Exception: raise gcmd.error( - "auto_wcs: improperly formatted entry for " + "206: auto_wcs: improperly formatted entry for " "point\n%s" % (gcmd.get_commandline())) for axis, coord in enumerate(coords): self.point_coords[point_idx][axis] = coord @@ -251,7 +251,7 @@ def cmd_SET_AUTO_WCS(self, gcmd): raise Exception except Exception: raise gcmd.error( - "auto_wcs: improperly formatted entry for " + "208: auto_wcs: improperly formatted entry for " "point\n%s" % (gcmd.get_commandline())) for axis, coord in enumerate(coords): self.wcs[point_idx][axis] = coord diff --git a/klippy/extras/b_axis_compensation.py b/klippy/extras/b_axis_compensation.py index 69c0ffa20dfc..f7721506449e 100644 --- a/klippy/extras/b_axis_compensation.py +++ b/klippy/extras/b_axis_compensation.py @@ -126,7 +126,7 @@ def cmd_SAVE_B_AXIS_POINT(self, gcmd): raise Exception except Exception: raise gcmd.error( - "b_axis_compensation: improperly formatted entry for " + "209: b_axis_compensation: improperly formatted entry for " "point\n%s" % (gcmd.get_commandline())) for axis, coord in enumerate(coords): self.point_coords[point_idx][axis] = coord diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py index ad01e9a4b848..d6c1e8118724 100644 --- a/klippy/extras/bed_mesh.py +++ b/klippy/extras/bed_mesh.py @@ -54,18 +54,18 @@ def parse_config_pair(config, option, default, minval=None, maxval=None): pair = config.getintlist(option, (default, default)) if len(pair) != 2: if len(pair) != 1: - raise config.error("bed_mesh: malformed '%s' value: %s" + raise config.error("2010: bed_mesh: malformed '%s' value: %s" % (option, config.get(option))) pair = (pair[0], pair[0]) if minval is not None: if pair[0] < minval or pair[1] < minval: raise config.error( - "Option '%s' in section bed_mesh must have a minimum of %s" + "2011: Option '%s' in section bed_mesh must have a minimum of %s" % (option, str(minval))) if maxval is not None: if pair[0] > maxval or pair[1] > maxval: raise config.error( - "Option '%s' in section bed_mesh must have a maximum of %s" + "2012: Option '%s' in section bed_mesh must have a maximum of %s" % (option, str(maxval))) return pair @@ -76,18 +76,18 @@ def parse_gcmd_pair(gcmd, name, minval=None, maxval=None): try: pair = [int(v.strip()) for v in gcmd.get(name).split(',')] except: - raise gcmd.error("Unable to parse parameter '%s'" % (name,)) + raise gcmd.error("2013: Unable to parse parameter '%s'" % (name,)) if len(pair) != 2: if len(pair) != 1: - raise gcmd.error("Unable to parse parameter '%s'" % (name,)) + raise gcmd.error("2014: Unable to parse parameter '%s'" % (name,)) pair = (pair[0], pair[0]) if minval is not None: if pair[0] < minval or pair[1] < minval: - raise gcmd.error("Parameter '%s' must have a minimum of %d" + raise gcmd.error("2015: Parameter '%s' must have a minimum of %d" % (name, minval)) if maxval is not None: if pair[0] > maxval or pair[1] > maxval: - raise gcmd.error("Parameter '%s' must have a maximum of %d" + raise gcmd.error("2016: Parameter '%s' must have a maximum of %d" % (name, maxval)) return pair @@ -98,7 +98,7 @@ def parse_gcmd_coord(gcmd, name): try: v1, v2 = [float(v.strip()) for v in gcmd.get(name).split(',')] except: - raise gcmd.error("Unable to parse parameter '%s'" % (name,)) + raise gcmd.error("2017: Unable to parse parameter '%s'" % (name,)) return v1, v2 @@ -167,7 +167,7 @@ def set_mesh(self, mesh): self.z_mesh = None self.fade_target = 0. raise self.gcode.error( - "bed_mesh: ERROR, fade_target lies outside of mesh z " + "2018: bed_mesh: ERROR, fade_target lies outside of mesh z " "range\nmin: %.4f, max: %.4f, fade_target: %.4f" % (min_z, max_z, err_target)) min_z, max_z = mesh.get_z_range() @@ -175,7 +175,7 @@ def set_mesh(self, mesh): self.z_mesh = None self.fade_target = 0. raise self.gcode.error( - "bed_mesh: Mesh extends outside of the fade range, " + "2019: bed_mesh: Mesh extends outside of the fade range, " "please see the fade_start and fade_end options in" "example-extras.cfg. fade distance: %.2f mesh min: %.4f" "mesh max: %.4f" % (self.fade_dist, min_z, max_z)) @@ -240,7 +240,7 @@ def move(self, newpos, speed): self.next_transform.move(split_move, speed) else: raise self.gcode.error( - "Mesh Leveling: Error splitting move ") + "2020: Mesh Leveling: Error splitting move ") self.last_position[:] = newpos def get_status(self, eventtime=None): @@ -348,7 +348,7 @@ def _generate_points(self, error): x_dist = math.floor(x_dist * 100) / 100 y_dist = math.floor(y_dist * 100) / 100 if x_dist < 1. or y_dist < 1.: - raise error("bed_mesh: min/max points too close together") + raise error("2021: bed_mesh: min/max points too close together") if self.radius is not None: # round bed, min/max needs to be recalculated @@ -416,7 +416,7 @@ def _generate_points(self, error): if dist_from_origin <= self.radius: valid_coords.append(ac) if not valid_coords: - raise error("bed_mesh: Unable to generate coordinates" + raise error("2022: bed_mesh: Unable to generate coordinates" " for faulty region at index: %d" % (i)) self.substituted_indices[i] = valid_coords @@ -454,7 +454,7 @@ def _init_mesh_config(self, config): # round beds must have an odd number of points along each axis if not x_cnt & 1: raise config.error( - "bed_mesh: probe_count must be odd for round beds") + "2023: bed_mesh: probe_count must be odd for round beds") # radius may have precision to .1mm self.radius = math.floor(self.radius * 10) / 10 orig_cfg['radius'] = self.radius @@ -468,7 +468,7 @@ def _init_mesh_config(self, config): min_x, min_y = config.getfloatlist('mesh_min', count=2) max_x, max_y = config.getfloatlist('mesh_max', count=2) if max_x <= min_x or max_y <= min_y: - raise config.error('bed_mesh: invalid min/max points') + raise config.error('2024: bed_mesh: invalid min/max points') orig_cfg['x_count'] = mesh_cfg['x_count'] = x_cnt orig_cfg['y_count'] = mesh_cfg['y_count'] = y_cnt orig_cfg['mesh_min'] = self.mesh_min = (min_x, min_y) @@ -504,7 +504,7 @@ def _init_mesh_config(self, config): for coord in [prev_c1, prev_c2, prev_c3, prev_c4]: if within(coord, c1, c3): raise config.error( - "bed_mesh: Existing faulty_region_%d %s overlaps " + "2025: bed_mesh: Existing faulty_region_%d %s overlaps " "added faulty_region_%d %s" % (j+1, repr([prev_c1, prev_c3]), i, repr([c1, c3]))) @@ -512,7 +512,7 @@ def _init_mesh_config(self, config): for coord in [c1, c2, c3, c4]: if within(coord, prev_c1, prev_c3): raise config.error( - "bed_mesh: Added faulty_region_%d %s overlaps " + "2026: bed_mesh: Added faulty_region_%d %s overlaps " "existing faulty_region_%d %s" % (i, repr([c1, c3]), j+1, repr([prev_c1, prev_c3]))) @@ -525,7 +525,7 @@ def _verify_algorithm(self, error): y_pps = params['mesh_y_pps'] if params['algo'] not in self.ALGOS: raise error( - "bed_mesh: Unknown algorithm <%s>" + "2027: bed_mesh: Unknown algorithm <%s>" % (self.mesh_config['algo'])) # Check the algorithm against the current configuration max_probe_cnt = max(params['x_count'], params['y_count']) @@ -537,20 +537,20 @@ def _verify_algorithm(self, error): # Lagrange interpolation tends to oscillate when using more # than 6 samples raise error( - "bed_mesh: cannot exceed a probe_count of 6 when using " + "2028: bed_mesh: cannot exceed a probe_count of 6 when using " "lagrange interpolation. Configured Probe Count: %d, %d" % (self.mesh_config['x_count'], self.mesh_config['y_count'])) elif params['algo'] == 'bicubic' and min_probe_cnt < 4: if max_probe_cnt > 6: raise error( - "bed_mesh: invalid probe_count option when using bicubic " + "2029: bed_mesh: invalid probe_count option when using bicubic " "interpolation. Combination of 3 points on one axis with " "more than 6 on another is not permitted. " "Configured Probe Count: %d, %d" % (self.mesh_config['x_count'], self.mesh_config['y_count'])) else: logging.info( - "bed_mesh: bicubic interpolation with a probe_count of " + "2030: bed_mesh: bicubic interpolation with a probe_count of " "less than 4 points detected. Forcing lagrange " "interpolation. Configured Probe Count: %d, %d" % (self.mesh_config['x_count'], self.mesh_config['y_count'])) @@ -641,7 +641,7 @@ def _get_adjusted_points(self): def cmd_BED_MESH_CALIBRATE(self, gcmd): self._profile_name = gcmd.get('PROFILE', "default") if not self._profile_name.strip(): - raise gcmd.error("Value for parameter 'PROFILE' must be specified") + raise gcmd.error("2031: Value for parameter 'PROFILE' must be specified") self.bedmesh.set_mesh(None) self.update_config(gcmd) self.probe_helper.start_probe(gcmd) @@ -686,7 +686,7 @@ def probe_finalize(self, offsets, positions): if len(self.points) != len(corrected_pts): self._dump_points(positions, corrected_pts, offsets) raise self.gcode.error( - "bed_mesh: invalid position list size, " + "2024: bed_mesh: invalid position list size, " "generated count: %d, probed count: %d" % (len(self.points), len(corrected_pts))) for gen_pt, probed in zip(self.points, corrected_pts): @@ -695,7 +695,7 @@ def probe_finalize(self, offsets, positions): not isclose(off_pt[1], probed[1], abs_tol=.1): self._dump_points(positions, corrected_pts, offsets) raise self.gcode.error( - "bed_mesh: point mismatch, orig = (%.2f, %.2f)" + "2024: bed_mesh: point mismatch, orig = (%.2f, %.2f)" ", probed = (%.2f, %.2f)" % (off_pt[0], off_pt[1], probed[0], probed[1])) positions = corrected_pts @@ -726,7 +726,7 @@ def probe_finalize(self, offsets, positions): # make sure the y-axis is the correct length if len(probed_matrix) != y_cnt: raise self.gcode.error( - ("bed_mesh: Invalid y-axis table length\n" + ("2024: bed_mesh: Invalid y-axis table length\n" "Probed table length: %d Probed Table:\n%s") % (len(probed_matrix), str(probed_matrix))) @@ -736,7 +736,7 @@ def probe_finalize(self, offsets, positions): row_size = len(row) if not row_size & 1: # an even number of points in a row shouldn't be possible - msg = "bed_mesh: incorrect number of points sampled on X\n" + msg = "2024: bed_mesh: incorrect number of points sampled on X\n" msg += "Probed Table:\n" msg += str(probed_matrix) raise self.gcode.error(msg) @@ -752,7 +752,7 @@ def probe_finalize(self, offsets, positions): for row in probed_matrix: if len(row) != x_cnt: raise self.gcode.error( - ("bed_mesh: invalid x-axis table length\n" + ("2024: bed_mesh: invalid x-axis table length\n" "Probed table length: %d Probed Table:\n%s") % (len(probed_matrix), str(probed_matrix))) @@ -760,7 +760,7 @@ def probe_finalize(self, offsets, positions): try: z_mesh.build_mesh(probed_matrix) except BedMeshError as e: - raise self.gcode.error(str(e)) + raise self.gcode.error("2024: %s" % str(e)) self.bedmesh.set_mesh(z_mesh) self.gcode.respond_info("Mesh Bed Leveling Complete") self.bedmesh.save_profile(self._profile_name) @@ -820,7 +820,7 @@ def _set_next_move(self, distance_from_prev): t = distance_from_prev / self.total_move_length if t > 1. or t < 0.: raise self.gcode.error( - "bed_mesh: Slice distance is negative " + "2024: bed_mesh: Slice distance is negative " "or greater than entire move length") for i in range(6): if self.axis_move[i]: @@ -1267,14 +1267,14 @@ def load_profile(self, prof_name): profile = self.profiles.get(prof_name, None) if profile is None: raise self.gcode.error( - "bed_mesh: Unknown profile [%s]" % prof_name) + "2024: bed_mesh: Unknown profile [%s]" % prof_name) probed_matrix = profile['points'] mesh_params = profile['mesh_params'] z_mesh = ZMesh(mesh_params) try: z_mesh.build_mesh(probed_matrix) except BedMeshError as e: - raise self.gcode.error(str(e)) + raise self.gcode.error("2024: %s" % str(e)) self.current_profile = prof_name self.bedmesh.set_mesh(z_mesh) @@ -1282,7 +1282,7 @@ def add_profile(self, prof_name, gcmd): profile = self.profiles.get(prof_name, None) if profile is None: raise self.gcode.error( - "bed_mesh: Unknown profile [%s]" % prof_name) + "2024: bed_mesh: Unknown profile [%s]" % prof_name) else: mesh_params = profile['mesh_params'] probed_matrix = list(list(line) for line in profile['points']) diff --git a/klippy/extras/bus.py b/klippy/extras/bus.py index f37897d83114..5021b6d712f5 100644 --- a/klippy/extras/bus.py +++ b/klippy/extras/bus.py @@ -19,10 +19,10 @@ def resolve_bus_name(mcu, param, bus): if bus is None: rev_enums = {v: k for k, v in enums.items()} if 0 not in rev_enums: - raise ppins.error("Must specify %s on mcu '%s'" % (param, mcu_name)) + raise ppins.error("3025: Must specify %s on mcu '%s'" % (param, mcu_name)) bus = rev_enums[0] if bus not in enums: - raise ppins.error("Unknown %s '%s'" % (param, bus)) + raise ppins.error("3026: Unknown %s '%s'" % (param, bus)) # Check for reserved bus pins constants = mcu.get_constants() reserve_pins = constants.get('BUS_PINS_%s' % (bus,), None) @@ -125,7 +125,7 @@ def MCU_SPI_from_config(config, mode, pin_option="cs_pin", for name in sw_pin_names] for pin_params in sw_pin_params: if pin_params['chip'] != mcu: - raise ppins.error("%s: spi pins must be on same mcu" % ( + raise ppins.error("3027: %s: spi pins must be on same mcu" % ( config.get_name(),)) sw_pins = tuple([pin_params['pin'] for pin_params in sw_pin_params]) bus = None @@ -223,7 +223,7 @@ def __init__(self, mcu, pin_desc, cmd_queue=None, value=0): ppins = mcu.get_printer().lookup_object('pins') pin_params = ppins.lookup_pin(pin_desc) if pin_params['chip'] is not mcu: - raise ppins.error("Pin %s must be on mcu %s" % ( + raise ppins.error("3028: Pin %s must be on mcu %s" % ( pin_desc, mcu.get_name())) mcu.add_config_cmd("config_digital_out oid=%d pin=%s value=%d" " default_value=%d max_duration=%d" diff --git a/klippy/extras/buttons.py b/klippy/extras/buttons.py index 1a6147d1df28..b33b2d0a1a9d 100644 --- a/klippy/extras/buttons.py +++ b/klippy/extras/buttons.py @@ -275,7 +275,7 @@ def register_buttons(self, pins, callback): for pin in pins: pin_params = ppins.lookup_pin(pin, can_invert=True, can_pullup=True) if mcu is not None and pin_params['chip'] != mcu: - raise ppins.error("button pins must be on same mcu") + raise ppins.error("3029: button pins must be on same mcu") mcu = pin_params['chip'] mcu_name = pin_params['chip_name'] pin_params_list.append(pin_params) @@ -294,7 +294,7 @@ def register_rotary_encoder(self, pin1, pin2, cw_callback, ccw_callback, re = FullStepRotaryEncoder(cw_callback, ccw_callback) else: raise self.printer.config_error( - "%d steps per detent not supported" % steps_per_detent) + "3030: %d steps per detent not supported" % steps_per_detent) self.register_buttons([pin1, pin2], re.encoder_callback) def register_button_push(self, pin, callback): def helper(eventtime, state, callback=callback): diff --git a/klippy/extras/c_axis_align.py b/klippy/extras/c_axis_align.py index 2adf74231889..a00b720f289b 100644 --- a/klippy/extras/c_axis_align.py +++ b/klippy/extras/c_axis_align.py @@ -32,7 +32,7 @@ def cmd_SAVE_C_AXIS_POINT(self, gcmd): raise Exception except Exception: raise gcmd.error( - "a_axis_offset: improperly formatted entry for " + "2032: a_axis_offset: improperly formatted entry for " "point\n%s" % (gcmd.get_commandline())) for axis, coord in enumerate(coords): self.point_coords[point_idx][axis] = coord diff --git a/klippy/extras/canbus_ids.py b/klippy/extras/canbus_ids.py index f96510fadfa5..5a8a3c66a956 100644 --- a/klippy/extras/canbus_ids.py +++ b/klippy/extras/canbus_ids.py @@ -12,13 +12,13 @@ def __init__(self, config): self.ids = {} def add_uuid(self, config, canbus_uuid, canbus_iface): if canbus_uuid in self.ids: - raise config.error("Duplicate canbus_uuid") + raise config.error("3031: Duplicate canbus_uuid") new_id = len(self.ids) + NODEID_FIRST self.ids[canbus_uuid] = new_id return new_id def get_nodeid(self, canbus_uuid): if canbus_uuid not in self.ids: - raise self.printer.config_error("Unknown canbus_uuid %s" + raise self.printer.config_error("3032: Unknown canbus_uuid %s" % (canbus_uuid,)) return self.ids[canbus_uuid] diff --git a/klippy/extras/controller_fan.py b/klippy/extras/controller_fan.py index df141e7eb7d1..333560f76da1 100644 --- a/klippy/extras/controller_fan.py +++ b/klippy/extras/controller_fan.py @@ -37,7 +37,7 @@ def handle_connect(self): return if not all(x in all_steppers for x in self.stepper_names): raise self.printer.config_error( - "One or more of these steppers are unknown: " + "3033: One or more of these steppers are unknown: " "%s (valid steppers are: %s)" % (self.stepper_names, ", ".join(all_steppers))) def handle_ready(self): diff --git a/klippy/extras/display/__init__.py b/klippy/extras/display/__init__.py index 1cea00e02297..53e42d6eb0bf 100644 --- a/klippy/extras/display/__init__.py +++ b/klippy/extras/display/__init__.py @@ -11,11 +11,11 @@ def load_config(config): def load_config_prefix(config): if not config.has_section('display'): raise config.error( - "A primary [display] section must be defined in printer.cfg " + "0018: A primary [display] section must be defined in printer.cfg " "to use auxilary displays") name = config.get_name().split()[-1] if name == "display": raise config.error( - "Section name [display display] is not valid. " + "0019: Section name [display display] is not valid. " "Please choose a different postfix.") return display.load_config(config) diff --git a/klippy/extras/endstop_phase.py b/klippy/extras/endstop_phase.py index feb9e8b8b082..4ffaaae75a19 100644 --- a/klippy/extras/endstop_phase.py +++ b/klippy/extras/endstop_phase.py @@ -39,7 +39,7 @@ def calc_phase(self, stepper, trig_mcu_pos): mcu_phase_offset, phases = self.tmc_module.get_phase_offset() if mcu_phase_offset is None: if self.printer.get_start_args().get('debugoutput') is None: - raise self.printer.command_error("Stepper %s phase unknown" + raise self.printer.command_error("3034: Stepper %s phase unknown" % (self.name,)) mcu_phase_offset = 0 phase = (trig_mcu_pos + mcu_phase_offset) % self.phases @@ -71,7 +71,7 @@ def __init__(self, config): if trigger_phase is not None: p, ps = config.getintlist('trigger_phase', sep='/', count=2) if p >= ps: - raise config.error("Invalid trigger_phase '%s'" + raise config.error("3035: Invalid trigger_phase '%s'" % (trigger_phase,)) self.endstop_phase = self.phase_calc.convert_phase(p, ps) self.endstop_align_zero = config.getboolean('endstop_align_zero', False) @@ -87,7 +87,7 @@ def __init__(self, config): self.endstop_phase_accuracy = int( math.ceil(self.endstop_accuracy / self.step_dist)) if self.endstop_phase_accuracy >= self.phases // 2: - raise config.error("Endstop for %s is not accurate enough for" + raise config.error("3036: Endstop for %s is not accurate enough for" " stepper phase adjustment" % (self.name,)) if self.printer.get_start_args().get('debugoutput') is not None: self.endstop_phase_accuracy = self.phases @@ -113,7 +113,7 @@ def get_homed_offset(self, stepper, trig_mcu_pos): delta -= self.phases elif delta > self.endstop_phase_accuracy: raise self.printer.command_error( - "Endstop %s incorrect phase (got %d vs %d)" % ( + "3037: Endstop %s incorrect phase (got %d vs %d)" % ( self.name, phase, self.endstop_phase)) return delta * self.step_dist def handle_home_rails_end(self, homing_state, rails): @@ -175,7 +175,7 @@ def cmd_ENDSTOP_PHASE_CALIBRATE(self, gcmd): return phase_calc = self.tracking.get(stepper_name) if phase_calc is None or phase_calc.phase_history is None: - raise gcmd.error("Stats not available for stepper %s" + raise gcmd.error("3037: Stats not available for stepper %s" % (stepper_name,)) endstop_phase, phases = self.generate_stats(stepper_name, phase_calc) if not phase_calc.is_primary: diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py index 2ba4d5de5df1..c49694aa5318 100644 --- a/klippy/extras/force_move.py +++ b/klippy/extras/force_move.py @@ -59,7 +59,7 @@ def register_stepper(self, config, mcu_stepper): def lookup_stepper(self, name): if name not in self.steppers: - raise self.printer.config_error("Unknown stepper %s" % (name,)) + raise self.printer.config_error("9011: Unknown stepper %s" % (name,)) return self.steppers[name] def _force_enable(self, stepper): @@ -106,7 +106,7 @@ def manual_move(self, stepper, dist, speed, accel=0.): def _lookup_stepper(self, gcmd): name = gcmd.get('STEPPER') if name not in self.steppers: - raise gcmd.error("Unknown stepper %s" % (name,)) + raise gcmd.error("9010: Unknown stepper %s" % (name,)) return self.steppers[name] cmd_STEPPER_BUZZ_help = "Oscillate a given stepper to help id it" diff --git a/klippy/extras/gcode_macro.py b/klippy/extras/gcode_macro.py index 063daf505f6c..b7985fb983e1 100644 --- a/klippy/extras/gcode_macro.py +++ b/klippy/extras/gcode_macro.py @@ -50,7 +50,7 @@ def __init__(self, printer, env, name, script): try: self.template = env.from_string(script) except Exception as e: - msg = "Error loading template '%s': %s" % ( + msg = "0016: Error loading template '%s': %s" % ( name, traceback.format_exception_only(type(e), e)[-1]) logging.exception(msg) raise printer.config_error(msg) @@ -60,7 +60,7 @@ def render(self, context=None): try: return str(self.template.render(context)) except Exception as e: - msg = "Error evaluating '%s': %s" % ( + msg = "0017: Error evaluating '%s': %s" % ( self.name, traceback.format_exception_only(type(e), e)[-1]) logging.exception(msg) raise self.gcode.error(msg) @@ -175,7 +175,7 @@ def handle_connect(self): prev_cmd = self.gcode.register_command(self.alias, None) if prev_cmd is None: raise self.printer.config_error( - "Existing command '%s' not found in gcode_macro rename" + "0020: Existing command '%s' not found in gcode_macro rename" % (self.alias,)) pdesc = "Renamed builtin of '%s'" % (self.alias,) self.gcode.register_command(self.rename_existing, prev_cmd, desc=pdesc) diff --git a/klippy/extras/gcode_move.py b/klippy/extras/gcode_move.py index 85943ecd3601..e889afb51496 100644 --- a/klippy/extras/gcode_move.py +++ b/klippy/extras/gcode_move.py @@ -128,7 +128,7 @@ def _handle_home_rails_end(self, homing_state, rails): def set_move_transform(self, transform, force=False): if self.move_transform is not None and not force: raise self.printer.config_error( - "G-Code move transform already specified") + "102: G-Code move transform already specified") old_transform = self.move_transform if old_transform is None: old_transform = self.printer.lookup_object('toolhead', None) @@ -218,7 +218,7 @@ def cmd_G1(self, gcmd): if 'F' in params: gcode_speed = float(params['F']) if gcode_speed <= 0.: - raise gcmd.error("Invalid speed in '%s'" + raise gcmd.error("103: Invalid speed in '%s'" % (gcmd.get_commandline(),)) self.speed = gcode_speed * self.speed_factor if with_rotation and self.radius > 0. and self.radial_speed_compensation_enabled: @@ -229,7 +229,7 @@ def cmd_G1(self, gcmd): if self.rotary_speed < self.square_corner_velocity: self.rotary_speed = self.square_corner_velocity except ValueError as e: - raise gcmd.error("Unable to parse move '%s'" + raise gcmd.error("104: Unable to parse move '%s'" % (gcmd.get_commandline(),)) self.move_with_transform(self.last_position, \ self.rotary_speed if with_rotation and self.radius > 0. \ @@ -341,7 +341,7 @@ def cmd_RESTORE_GCODE_STATE(self, gcmd): state_name = gcmd.get('NAME', 'default') state = self.saved_states.get(state_name) if state is None: - raise gcmd.error("Unknown g-code state: %s" % (state_name,)) + raise gcmd.error("105: Unknown g-code state: %s" % (state_name,)) # Restore state self.absolute_coord = state['absolute_coord'] self.absolute_extrude = state['absolute_extrude'] @@ -417,7 +417,7 @@ def cmd_LOAD_GCODE_STATE(self, gcmd): def cmd_GET_POSITION(self, gcmd): toolhead = self.printer.lookup_object('toolhead', None) if toolhead is None: - raise gcmd.error("Printer not ready") + raise gcmd.error("106: Printer not ready") kin = toolhead.get_kinematics() steppers = kin.get_steppers() mcu_pos = " ".join(["%s:%d" % (s.get_name(), s.get_mcu_position()) @@ -695,11 +695,11 @@ def process_move_with_compensation(self, gcmd): if 'F' in params: gcode_speed = float(params['F']) if gcode_speed <= 0.: - raise gcmd.error("Invalid speed in '%s'" + raise gcmd.error("107: Invalid speed in '%s'" % (gcmd.get_commandline(),)) self.speed = gcode_speed * self.speed_factor except ValueError as e: - raise gcmd.error("Unable to parse move '%s'" + raise gcmd.error("108: Unable to parse move '%s'" % (gcmd.get_commandline(),)) positions = self._calc_compensation(new_position) for position in positions: diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index b0b2c16df6af..a0c5975992de 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -96,7 +96,7 @@ def get_smooth_time(self): def set_temp(self, degrees): if degrees and (degrees < self.min_temp or degrees > self.max_temp): raise self.printer.command_error( - "Requested temperature (%.1f) out of range (%.1f:%.1f)" + "3039: Requested temperature (%.1f) out of range (%.1f:%.1f)" % (degrees, self.min_temp, self.max_temp)) with self.lock: self.target_temp = degrees @@ -250,7 +250,7 @@ def load_config(self, config): try: dconfig = pconfig.read_config(filename) except Exception: - raise config.config_error("Cannot load config '%s'" % (filename,)) + raise config.config_error("3040: Cannot load config '%s'" % (filename,)) for c in dconfig.get_prefix_sections(''): self.printer.load_object(dconfig, c.get_name()) def add_sensor_factory(self, sensor_type, sensor_factory): @@ -258,7 +258,7 @@ def add_sensor_factory(self, sensor_type, sensor_factory): def setup_heater(self, config, gcode_id=None): heater_name = config.get_name().split()[-1] if heater_name in self.heaters: - raise config.error("Heater %s already registered" % (heater_name,)) + raise config.error("3041: Heater %s already registered" % (heater_name,)) # Setup sensor sensor = self.setup_sensor(config) # Create heater @@ -271,7 +271,7 @@ def get_all_heaters(self): def lookup_heater(self, heater_name): if heater_name not in self.heaters: raise self.printer.config_error( - "Unknown heater '%s'" % (heater_name,)) + "3042: Unknown heater '%s'" % (heater_name,)) return self.heaters[heater_name] def setup_sensor(self, config): if not self.have_load_sensors: @@ -279,7 +279,7 @@ def setup_sensor(self, config): sensor_type = config.get('sensor_type') if sensor_type not in self.sensor_factories: raise self.printer.config_error( - "Unknown temperature sensor '%s'" % (sensor_type,)) + "3044: Unknown temperature sensor '%s'" % (sensor_type,)) if sensor_type == 'NTC 100K beta 3950': config.deprecate('sensor_type', 'NTC 100K beta 3950') return self.sensor_factories[sensor_type](config) @@ -291,7 +291,7 @@ def register_sensor(self, config, psensor, gcode_id=None): return if gcode_id in self.gcode_id_to_sensor: raise self.printer.config_error( - "G-Code sensor id %s already registered" % (gcode_id,)) + "3043: G-Code sensor id %s already registered" % (gcode_id,)) self.gcode_id_to_sensor[gcode_id] = psensor def get_status(self, eventtime): return {'available_heaters': self.available_heaters, @@ -344,12 +344,12 @@ def set_temperature(self, heater, temp, wait=False): def cmd_TEMPERATURE_WAIT(self, gcmd): sensor_name = gcmd.get('SENSOR') if sensor_name not in self.available_sensors: - raise gcmd.error("Unknown sensor '%s'" % (sensor_name,)) + raise gcmd.error("3046: Unknown sensor '%s'" % (sensor_name,)) min_temp = gcmd.get_float('MINIMUM', float('-inf')) max_temp = gcmd.get_float('MAXIMUM', float('inf'), above=min_temp) if min_temp == float('-inf') and max_temp == float('inf'): raise gcmd.error( - "Error on 'TEMPERATURE_WAIT': missing MINIMUM or MAXIMUM.") + "3045: Error on 'TEMPERATURE_WAIT': missing MINIMUM or MAXIMUM.") if self.printer.get_start_args().get('debugoutput') is not None: return if sensor_name in self.heaters: diff --git a/klippy/extras/homing.py b/klippy/extras/homing.py index 877f2f9bfad7..eb859bafc4e0 100644 --- a/klippy/extras/homing.py +++ b/klippy/extras/homing.py @@ -149,7 +149,7 @@ def homing_move(self, movepos, speed, probe_pos=False, if error is None: error = str(e) if error is not None: - raise self.printer.command_error(error) + raise self.printer.command_error("3047: %s" % error) return trigpos def check_no_movement(self): @@ -235,7 +235,7 @@ def home_rails(self, rails, forcepos, movepos): hmove.homing_move(homepos, hi.second_homing_speed) if hmove.check_no_movement() is not None: raise self.printer.command_error( - "Endstop %s still triggered after retract" + "3048: Endstop %s still triggered after retract" % (hmove.check_no_movement(),)) # Signal home operation complete self.toolhead.flush_step_generation() @@ -272,7 +272,7 @@ def manual_home(self, toolhead, endstops, pos, speed, except self.printer.command_error: if self.printer.is_shutdown(): raise self.printer.command_error( - "Homing failed due to printer shutdown") + "3049: Homing failed due to printer shutdown") raise def probing_move(self, mcu_probe, pos, speed): @@ -283,11 +283,11 @@ def probing_move(self, mcu_probe, pos, speed): except self.printer.command_error: if self.printer.is_shutdown(): raise self.printer.command_error( - "Probing failed due to printer shutdown") + "3050: Probing failed due to printer shutdown") raise if hmove.check_no_movement() is not None: raise self.printer.command_error( - "Probe triggered prior to movement") + "3051: Probe triggered prior to movement") return epos def cmd_G28(self, gcmd): @@ -307,7 +307,7 @@ def cmd_G28(self, gcmd): except self.printer.command_error: if self.printer.is_shutdown(): raise self.printer.command_error( - "Homing failed due to printer shutdown") + "3052: Homing failed due to printer shutdown") self.printer.lookup_object('stepper_enable').motor_off() raise diff --git a/klippy/extras/output_pin.py b/klippy/extras/output_pin.py index 8b41aca7a454..1f00510c44ad 100644 --- a/klippy/extras/output_pin.py +++ b/klippy/extras/output_pin.py @@ -78,7 +78,7 @@ def cmd_SET_PIN(self, gcmd): cycle_time = gcmd.get_float('CYCLE_TIME', self.default_cycle_time, above=0., maxval=MAX_SCHEDULE_TIME) if not self.is_pwm and value not in [0., 1.]: - raise gcmd.error("Invalid pin value") + raise gcmd.error("3053: Invalid pin value") toolhead = self.printer.lookup_object('toolhead') toolhead.register_lookahead_callback( lambda print_time: self._set_pin(print_time, value, cycle_time)) diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index f32f1be79856..7c5f64cfa43c 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -21,7 +21,7 @@ def cmd_PID_CALIBRATE(self, gcmd): try: heater = pheaters.lookup_heater(heater_name) except self.printer.config_error as e: - raise gcmd.error(str(e)) + raise gcmd.error("3054: %s" % str(e)) self.printer.lookup_object('toolhead').get_last_move_time() calibrate = ControlAutoTune(heater, target) old_control = heater.set_control(calibrate) @@ -34,7 +34,7 @@ def cmd_PID_CALIBRATE(self, gcmd): if write_file: calibrate.write_file('/tmp/heattest.txt') if calibrate.check_busy(0., 0., 0.): - raise gcmd.error("pid_calibrate interrupted") + raise gcmd.error("3054: pid_calibrate interrupted") # Log and report results Kp, Ki, Kd = calibrate.calc_final_pid() logging.info("Autotune: final: Kp=%f Ki=%f Kd=%f", Kp, Ki, Kd) diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py index 1b182b1ca3e8..33e93c6677fd 100644 --- a/klippy/extras/probe.py +++ b/klippy/extras/probe.py @@ -106,9 +106,9 @@ def multi_probe_end(self): self.mcu_probe.multi_probe_end() def setup_pin(self, pin_type, pin_params): if pin_type != 'endstop' or pin_params['pin'] != 'z_virtual_endstop': - raise pins.error("Probe virtual endstop only useful as endstop pin") + raise pins.error("2033: Probe virtual endstop only useful as endstop pin") if pin_params['invert'] or pin_params['pullup']: - raise pins.error("Can not pullup/invert probe virtual endstop") + raise pins.error("2034: Can not pullup/invert probe virtual endstop") return self.mcu_probe def get_lift_speed(self, gcmd=None): if gcmd is not None: @@ -120,7 +120,7 @@ def _probe(self, speed, axis='z', positive_direction=0): toolhead = self.printer.lookup_object('toolhead') curtime = self.printer.get_reactor().monotonic() if axis not in toolhead.get_status(curtime)['homed_axes']: - raise self.printer.command_error("Must home before probe") + raise self.printer.command_error("2035: Must home before probe") axis_index = 'xyz'.index(axis) phoming = self.printer.lookup_object('homing') pos = toolhead.get_position() @@ -131,7 +131,7 @@ def _probe(self, speed, axis='z', positive_direction=0): reason = str(e) if "Timeout during endstop homing" in reason: reason += HINT_TIMEOUT - raise self.printer.command_error(reason) + raise self.printer.command_error("2036: %s" % reason) self.gcode.respond_info("probe at x=%.3f y=%.3f z=%.6f" % (epos[0], epos[1], epos[2])) return epos[:3] @@ -184,7 +184,7 @@ def run_probe(self, gcmd): axis_positions = [p[axis_index] for p in positions] if max(axis_positions) - min(axis_positions) > samples_tolerance: if retries >= samples_retries: - raise gcmd.error("Probe samples exceed samples_tolerance") + raise gcmd.error("2037: Probe samples exceed samples_tolerance") gcmd.respond_info("Probe samples exceed tolerance. Retrying...") retries += 1 positions = [] @@ -358,14 +358,14 @@ def raise_probe(self): self.deactivate_gcode.run_gcode_from_command() if toolhead.get_position()[:3] != start_pos[:3]: raise self.printer.command_error( - "Toolhead moved during probe activate_gcode script") + "2038: Toolhead moved during probe activate_gcode script") def lower_probe(self): toolhead = self.printer.lookup_object('toolhead') start_pos = toolhead.get_position() self.activate_gcode.run_gcode_from_command() if toolhead.get_position()[:3] != start_pos[:3]: raise self.printer.command_error( - "Toolhead moved during probe deactivate_gcode script") + "2039: Toolhead moved during probe deactivate_gcode script") def multi_probe_begin(self): if self.stow_on_each_sample: return @@ -410,7 +410,7 @@ def __init__(self, config, finalize_callback, default_points=None): def minimum_points(self,n): if len(self.probe_points) < n: raise self.printer.config_error( - "Need at least %d probe points for %s" % (n, self.name)) + "2040: Need at least %d probe points for %s" % (n, self.name)) def update_probe_points(self, points, min_points): self.probe_points = points self.minimum_points(min_points) @@ -459,7 +459,7 @@ def start_probe(self, gcmd): self.lift_speed = probe.get_lift_speed(gcmd) self.probe_offsets = probe.get_offsets() if self.horizontal_move_z < self.probe_offsets[2]: - raise gcmd.error("horizontal_move_z can't be less than" + raise gcmd.error("2041: horizontal_move_z can't be less than" " probe's z_offset") probe.multi_probe_begin() while 1: diff --git a/klippy/extras/safe_z_home.py b/klippy/extras/safe_z_home.py index ca9b8eb59ea3..eeacfea85d53 100644 --- a/klippy/extras/safe_z_home.py +++ b/klippy/extras/safe_z_home.py @@ -21,7 +21,7 @@ def __init__(self, config): self.gcode.register_command("G28", self.cmd_G28) if config.has_section("homing_override"): - raise config.error("homing_override and safe_z_homing cannot" + raise config.error("1010: homing_override and safe_z_homing cannot" +" be used simultaneously") def cmd_G28(self, gcmd): @@ -70,7 +70,7 @@ def cmd_G28(self, gcmd): kin_status = toolhead.get_kinematics().get_status(curtime) if ('x' not in kin_status['homed_axes'] or 'y' not in kin_status['homed_axes']): - raise gcmd.error("Must home X and Y axes first") + raise gcmd.error("109: Must home X and Y axes first") # Move to safe XY homing position prevpos = toolhead.get_position() toolhead.manual_move([self.home_x_pos, self.home_y_pos], self.speed) diff --git a/klippy/extras/save_variables.py b/klippy/extras/save_variables.py index fb6ce1b824d6..d3bbee954caa 100644 --- a/klippy/extras/save_variables.py +++ b/klippy/extras/save_variables.py @@ -17,7 +17,7 @@ def __init__(self, config): # open(self.filename, "w").close() self.loadVariables() except self.printer.command_error as e: - raise config.error(str(e)) + raise config.error("9011: %s" % str(e)) gcode = self.printer.lookup_object('gcode') gcode.register_command('SAVE_VARIABLE', self.cmd_SAVE_VARIABLE, desc=self.cmd_SAVE_VARIABLE_help) @@ -30,7 +30,7 @@ def loadVariables(self): for name, val in varfile.items('Variables'): allvars[name] = ast.literal_eval(val) except: - msg = "Unable to parse existing variable file" + msg = "9012: Unable to parse existing variable file" logging.exception(msg) raise self.printer.command_error(msg) self.allVariables = allvars @@ -43,7 +43,7 @@ def cmd_SAVE_VARIABLE(self, gcmd): try: value = ast.literal_eval(value) except ValueError as e: - raise gcmd.error("Unable to parse '%s' as a literal" % (value,)) + raise gcmd.error("9013: Unable to parse '%s' as a literal" % (value,)) newvars = dict(self.allVariables) newvars[varname] = value # Write file @@ -56,7 +56,7 @@ def cmd_SAVE_VARIABLE(self, gcmd): varfile.write(f) f.close() except: - msg = "Unable to save variable" + msg = "9014: Unable to save variable" logging.exception(msg) raise gcmd.error(msg) self.loadVariables() diff --git a/klippy/extras/skew_correction.py b/klippy/extras/skew_correction.py index 5e89d193bc7f..ba6cc2208132 100644 --- a/klippy/extras/skew_correction.py +++ b/klippy/extras/skew_correction.py @@ -116,7 +116,7 @@ def cmd_SAVE_SKEW_POINT(self, gcmd): raise Exception except Exception: raise gcmd.error( - "skew_corection: improperly formatted entry for " + "2042: skew_corection: improperly formatted entry for " "point\n%s" % (gcmd.get_commandline())) for axis, coord in enumerate(coords): self.point_coords[point_idx][axis] = coord @@ -185,7 +185,7 @@ def cmd_CALC_SKEW_COMPENSATION(self, gcmd): gcmd.respond_info(out) else: raise gcmd.error( - "Error! Factor name %s not in list factors['XY', 'XZ', 'YZ']" % (factor_name)) + "2043: Error! Factor name %s not in list factors['XY', 'XZ', 'YZ']" % (factor_name)) cmd_CALC_SKEW_COMPENSATION_help = "Calculate skew compensation." cmd_CALC_SKEW_COMPENSATION_WCS_help = "Calculate skew compensation by wcs." @@ -333,7 +333,7 @@ def cmd_SET_SKEW(self, gcmd): gcmd.respond_info(out) except Exception: raise gcmd.error( - "skew_correction: improperly formatted entry for " + "2044: skew_correction: improperly formatted entry for " "plane [%s]\n%s" % (plane, gcmd.get_commandline())) cmd_SET_SKEW_help = "Set skews(XY=0.1, ...), delete skews(CLEAR=1) \ or include skew correction(ENABLE=1) its." diff --git a/klippy/extras/stepper_enable.py b/klippy/extras/stepper_enable.py index 621ff700e2ac..8998861411f0 100644 --- a/klippy/extras/stepper_enable.py +++ b/klippy/extras/stepper_enable.py @@ -128,7 +128,7 @@ def cmd_SET_STEPPER_ENABLE(self, gcmd): self.motor_debug_enable(stepper_name, stepper_enable) def lookup_enable(self, name): if name not in self.enable_lines: - raise self.printer.config_error("Unknown stepper '%s'" % (name,)) + raise self.printer.config_error("3056: Unknown stepper '%s'" % (name,)) return self.enable_lines[name] def get_steppers(self): return list(self.enable_lines.keys()) diff --git a/klippy/extras/temperature_fan.py b/klippy/extras/temperature_fan.py index aee94f281594..af88d019a589 100644 --- a/klippy/extras/temperature_fan.py +++ b/klippy/extras/temperature_fan.py @@ -84,7 +84,7 @@ def cmd_SET_TEMPERATURE_FAN_TARGET(self, gcmd): max_speed = gcmd.get_float('MAX_SPEED', self.max_speed) if min_speed > max_speed: raise self.printer.command_error( - "Requested min speed (%.1f) is greater than max speed (%.1f)" + "3057: Requested min speed (%.1f) is greater than max speed (%.1f)" % (min_speed, max_speed)) self.set_min_speed(min_speed) self.set_max_speed(max_speed) @@ -92,21 +92,21 @@ def cmd_SET_TEMPERATURE_FAN_TARGET(self, gcmd): def set_temp(self, degrees): if degrees and (degrees < self.min_temp or degrees > self.max_temp): raise self.printer.command_error( - "Requested temperature (%.1f) out of range (%.1f:%.1f)" + "3058: Requested temperature (%.1f) out of range (%.1f:%.1f)" % (degrees, self.min_temp, self.max_temp)) self.target_temp = degrees def set_min_speed(self, speed): if speed and (speed < 0. or speed > 1.): raise self.printer.command_error( - "Requested min speed (%.1f) out of range (0.0 : 1.0)" + "3059: Requested min speed (%.1f) out of range (0.0 : 1.0)" % (speed)) self.min_speed = speed def set_max_speed(self, speed): if speed and (speed < 0. or speed > 1.): raise self.printer.command_error( - "Requested max speed (%.1f) out of range (0.0 : 1.0)" + "3060: Requested max speed (%.1f) out of range (0.0 : 1.0)" % (speed)) self.max_speed = speed diff --git a/klippy/extras/temperature_host.py b/klippy/extras/temperature_host.py index 94a736033d19..8c25132b5466 100644 --- a/klippy/extras/temperature_host.py +++ b/klippy/extras/temperature_host.py @@ -26,7 +26,7 @@ def __init__(self, config): try: self.file_handle = open(self.path, "r") except: - raise config.error("Unable to open temperature file '%s'" + raise config.error("3061: Unable to open temperature file '%s'" % (self.path,)) self.printer.register_event_handler("klippy:connect", diff --git a/klippy/extras/temperature_mcu.py b/klippy/extras/temperature_mcu.py index 585ec4c1d20d..5717ff03de92 100644 --- a/klippy/extras/temperature_mcu.py +++ b/klippy/extras/temperature_mcu.py @@ -94,7 +94,7 @@ def _mcu_identify(self): minval=min(adc_range), maxval=max(adc_range), range_check_count=RANGE_CHECK_COUNT) def config_unknown(self): - raise self.printer.config_error("MCU temperature not supported on %s" + raise self.printer.config_error("3062: MCU temperature not supported on %s" % (self.mcu_type,)) def config_rp2040(self): self.slope = 3.3 / -0.001721 diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py index 28f7be6fc01f..109665188b14 100644 --- a/klippy/extras/tmc.py +++ b/klippy/extras/tmc.py @@ -157,7 +157,9 @@ def _query_register(self, reg_info, try_clear=False): count += 1 if count >= 3: fmt = self.fields.pretty_format(reg_name, val) - raise self.printer.command_error("TMC '%s' reports error: %s" + logging.error("3070: TMC '%s' reports error: %s" + % (self.stepper_name, fmt)) + raise self.printer.command_error("3070: TMC '%s' reports error: %s" % (self.stepper_name, fmt)) if try_clear and val & err_mask: try_clear = False @@ -271,14 +273,14 @@ def cmd_SET_TMC_FIELD(self, gcmd): field_name = gcmd.get('FIELD').lower() reg_name = self.fields.lookup_register(field_name, None) if reg_name is None: - raise gcmd.error("Unknown field name '%s'" % (field_name,)) + raise gcmd.error("3071: Unknown field name '%s'" % (field_name,)) value = gcmd.get_int('VALUE', None) velocity = gcmd.get_float('VELOCITY', None, minval=0.) tmc_frequency = self.mcu_tmc.get_tmc_frequency() if tmc_frequency is None and velocity is not None: - raise gcmd.error("VELOCITY parameter not supported by this driver") + raise gcmd.error("3072: VELOCITY parameter not supported by this driver") if (value is None) == (velocity is None): - raise gcmd.error("Specify either VALUE or VELOCITY") + raise gcmd.error("3073: Specify either VALUE or VELOCITY") if velocity is not None: step_dist = self.stepper.get_step_dist() mres = self.fields.get_field("mres") @@ -441,7 +443,7 @@ def cmd_DUMP_TMC(self, gcmd): reg_name, val = self.read_translate(reg_name, val) gcmd.respond_info(self.fields.pretty_format(reg_name, val)) else: - raise gcmd.error("Unknown register name '%s'" % (reg_name)) + raise gcmd.error("3074: Unknown register name '%s'" % (reg_name)) else: gcmd.respond_info("========== Write-only registers ==========") for reg_name, val in self.fields.registers.items(): @@ -486,11 +488,11 @@ def setup_pin(self, pin_type, pin_params): # Validate pin ppins = self.printer.lookup_object('pins') if pin_type != 'endstop' or pin_params['pin'] != 'virtual_endstop': - raise ppins.error("tmc virtual endstop only useful as endstop") + raise ppins.error("3075: tmc virtual endstop only useful as endstop") if pin_params['invert'] or pin_params['pullup']: - raise ppins.error("Can not pullup/invert tmc virtual pin") + raise ppins.error("3076: Can not pullup/invert tmc virtual pin") if self.diag_pin is None: - raise ppins.error("tmc virtual endstop requires diag pin config") + raise ppins.error("3077: tmc virtual endstop requires diag pin config") # Setup for sensorless homing self.printer.register_event_handler("homing:homing_move_begin", self.handle_homing_move_begin) @@ -566,7 +568,7 @@ def TMCMicrostepHelper(config, mcu_tmc): stepper_name = " ".join(config.get_name().split()[1:]) if not config.has_section(stepper_name): raise config.error( - "Could not find config section '[%s]' required by tmc driver" + "3078: Could not find config section '[%s]' required by tmc driver" % (stepper_name,)) stepper_config = ms_config = config.getsection(stepper_name) if (stepper_config.get('microsteps', None, note_valid=False) is None diff --git a/klippy/extras/tmc2130.py b/klippy/extras/tmc2130.py index 62a9abbfe56b..d157c302aac3 100644 --- a/klippy/extras/tmc2130.py +++ b/klippy/extras/tmc2130.py @@ -239,10 +239,10 @@ def lookup_tmc_spi_chain(config): if tmc_spi is None: tmc_spi = cs_pin_params['class'] = MCU_TMC_SPI_chain(config, chain_len) if chain_len != tmc_spi.chain_len: - raise config.error("TMC SPI chain must have same length") + raise config.error("3079: TMC SPI chain must have same length") chain_pos = config.getint('chain_position', minval=1, maxval=chain_len) if chain_pos in tmc_spi.taken_chain_positions: - raise config.error("TMC SPI chain can not have duplicate position") + raise config.error("3080: TMC SPI chain can not have duplicate position") tmc_spi.taken_chain_positions.append(chain_pos) return tmc_spi, chain_pos @@ -271,7 +271,7 @@ def set_register(self, reg_name, val, print_time=None): if v == val: return raise self.printer.command_error( - "Unable to write tmc spi '%s' register %s" % (self.name, reg_name)) + "3081: Unable to write tmc spi '%s' register %s" % (self.name, reg_name)) def get_tmc_frequency(self): return self.tmc_frequency diff --git a/klippy/extras/tmc_uart.py b/klippy/extras/tmc_uart.py index 4d5ec1d5a257..09dbf36a06ca 100644 --- a/klippy/extras/tmc_uart.py +++ b/klippy/extras/tmc_uart.py @@ -36,11 +36,11 @@ def get_instance_id(self, select_pins_desc): for pin_params in select_pin_params: if pin_params['chip'] != self.mcu: raise self.mcu.get_printer().config_error( - "TMC mux pins must be on the same mcu") + "3063: TMC mux pins must be on the same mcu") pins = [pp['pin'] for pp in select_pin_params] if pins != self.pins: raise self.mcu.get_printer().config_error( - "All TMC mux instances must use identical pins") + "3064: All TMC mux instances must use identical pins") return tuple([not pp['invert'] for pp in select_pin_params]) def activate(self, instance_id): for oid, old, new in zip(self.oids, self.pin_values, instance_id): @@ -109,13 +109,13 @@ def register_instance(self, rx_pin_params, tx_pin_params, or tx_pin_params['pin'] != self.tx_pin or (select_pins_desc is None) != (self.analog_mux is None)): raise self.mcu.get_printer().config_error( - "Shared TMC uarts must use the same pins") + "3065: Shared TMC uarts must use the same pins") instance_id = None if self.analog_mux is not None: instance_id = self.analog_mux.get_instance_id(select_pins_desc) if (instance_id, addr) in self.instances: raise self.mcu.get_printer().config_error( - "Shared TMC uarts need unique address or select_pins polarity") + "3066: Shared TMC uarts need unique address or select_pins polarity") self.instances[(instance_id, addr)] = True return instance_id def _calc_crc8(self, data): @@ -196,7 +196,7 @@ def lookup_tmc_uart_bitbang(config, max_addr): else: tx_pin_params = ppins.lookup_pin(tx_pin_desc, share_type="tmc_uart_tx") if rx_pin_params['chip'] is not tx_pin_params['chip']: - raise ppins.error("TMC uart rx and tx pins must be on the same mcu") + raise ppins.error("3067: TMC uart rx and tx pins must be on the same mcu") select_pins_desc = config.getlist('select_pins', None) addr = config.getint('uart_address', 0, minval=0, maxval=max_addr) mcu_uart = rx_pin_params.get('class') @@ -231,7 +231,7 @@ def _do_get_register(self, reg_name): if val is not None: return val raise self.printer.command_error( - "Unable to read tmc uart '%s' register %s" % (self.name, reg_name)) + "3068: Unable to read tmc uart '%s' register %s" % (self.name, reg_name)) def get_register(self, reg_name): with self.mutex: return self._do_get_register(reg_name) @@ -250,6 +250,6 @@ def set_register(self, reg_name, val, print_time=None): if self.ifcnt == (ifcnt + 1) & 0xff: return raise self.printer.command_error( - "Unable to write tmc uart '%s' register %s" % (self.name, reg_name)) + "3069: Unable to write tmc uart '%s' register %s" % (self.name, reg_name)) def get_tmc_frequency(self): return self.tmc_frequency diff --git a/klippy/extras/virtual_sdcard.py b/klippy/extras/virtual_sdcard.py index 4e5ae6695204..a3b5c9e7af59 100644 --- a/klippy/extras/virtual_sdcard.py +++ b/klippy/extras/virtual_sdcard.py @@ -83,8 +83,8 @@ def get_file_list(self, check_subdirs=False): if not fname.startswith('.') and os.path.isfile((os.path.join(dname, fname)))] except: - logging.exception("virtual_sdcard get_file_list") - raise self.gcode.error("Unable to get file list") + logging.exception("1011: virtual_sdcard get_file_list") + raise self.gcode.error("1011: Unable to get file list") def get_status(self, eventtime): return { 'file_path': self.file_path(), @@ -113,7 +113,7 @@ def do_pause(self): self.reactor.pause(self.reactor.monotonic() + .001) def do_resume(self): if self.work_timer is not None: - raise self.gcode.error("SD busy") + raise self.gcode.error("1017: SD busy") self.must_pause_work = False self.work_timer = self.reactor.register_timer( self.work_handler, self.reactor.NOW) @@ -126,7 +126,7 @@ def do_cancel(self): self.file_position = self.file_size = 0. # G-Code commands def cmd_error(self, gcmd): - raise gcmd.error("SD write not supported") + raise gcmd.error("1012: SD write not supported") def _reset_file(self): if self.current_file is not None: self.do_pause() @@ -140,13 +140,13 @@ def _reset_file(self): def cmd_SDCARD_RESET_FILE(self, gcmd): if self.cmd_from_sd: raise gcmd.error( - "SDCARD_RESET_FILE cannot be run from the sdcard") + "1013: SDCARD_RESET_FILE cannot be run from the sdcard") self._reset_file() cmd_SDCARD_PRINT_FILE_help = "Loads a SD file and starts the print. May "\ "include files in subdirectories." def cmd_SDCARD_PRINT_FILE(self, gcmd): if self.work_timer is not None: - raise gcmd.error("SD busy") + raise gcmd.error("1014: SD busy") self._reset_file() filename = gcmd.get("FILENAME") file_position = gcmd.get_int('POSITION', 0) @@ -167,7 +167,7 @@ def cmd_M21(self, gcmd): def cmd_M23(self, gcmd): # Select SD file if self.work_timer is not None: - raise gcmd.error("SD busy") + raise gcmd.error("1015: SD busy") self._reset_file() filename = gcmd.get_raw_command_parameters().strip() if filename.startswith('/'): @@ -187,8 +187,8 @@ def _load_file(self, gcmd, filename, file_position=0, check_subdirs=False): fsize = f.tell() f.seek(0) except: - logging.exception("virtual_sdcard file open") - raise gcmd.error("Unable to open file") + logging.exception("1016: virtual_sdcard file open") + raise gcmd.error("1016: Unable to open file") gcmd.respond_raw("File opened:%s Size:%d" % (filename, fsize)) gcmd.respond_raw("File selected") self.current_file = f @@ -204,7 +204,7 @@ def cmd_M25(self, gcmd): def cmd_M26(self, gcmd): # Set SD position if self.work_timer is not None: - raise gcmd.error("SD busy") + raise gcmd.error("1018: SD busy") pos = gcmd.get_int('S', minval=0) self.file_position = pos def cmd_M27(self, gcmd): diff --git a/klippy/gcode.py b/klippy/gcode.py index 16356cd7d275..93492a710921 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -64,19 +64,19 @@ def get(self, name, default=sentinel, parser=str, minval=None, maxval=None, try: value = parser(value) except: - raise self.error("Error on '%s': unable to parse %s" + raise self.error("903: Error on '%s': unable to parse %s" % (self._commandline, value)) if minval is not None and value < minval: - raise self.error("Error on '%s': %s must have minimum of %s" + raise self.error("903: Error on '%s': %s must have minimum of %s" % (self._commandline, name, minval)) if maxval is not None and value > maxval: - raise self.error("Error on '%s': %s must have maximum of %s" + raise self.error("903: Error on '%s': %s must have maximum of %s" % (self._commandline, name, maxval)) if above is not None and value <= above: - raise self.error("Error on '%s': %s must be above %s" + raise self.error("903: Error on '%s': %s must be above %s" % (self._commandline, name, above)) if below is not None and value >= below: - raise self.error("Error on '%s': %s must be below %s" + raise self.error("903: Error on '%s': %s must be below %s" % (self._commandline, name, below)) return value def get_int(self, name, default=sentinel, minval=None, maxval=None): @@ -130,7 +130,7 @@ def register_command(self, cmd, func, when_not_ready=False, desc=None): return old_cmd if cmd in self.ready_gcode_handlers: raise self.printer.config_error( - "gcode command %s already registered" % (cmd,)) + "0012: gcode command %s already registered" % (cmd,)) if not self.is_traditional_gcode(cmd): origfunc = func func = lambda params: origfunc(self._get_extended_params(params)) @@ -148,11 +148,11 @@ def register_mux_command(self, cmd, key, value, func, desc=None): prev_key, prev_values = prev if prev_key != key: raise self.printer.config_error( - "mux command %s %s %s may have only one key (%s)" % ( + "0013: mux command %s %s %s may have only one key (%s)" % ( cmd, key, value, prev_key)) if value in prev_values: raise self.printer.config_error( - "mux command %s %s %s already registered (%s)" % ( + "0014: mux command %s %s %s already registered (%s)" % ( cmd, key, value, prev_values)) prev_values[value] = func def get_command_help(self): @@ -200,13 +200,13 @@ def _process_commands(self, commands, need_ack=True): try: handler(gcmd) except self.error as e: - self._respond_error('Internal error on command: "%s", error: "%s\n"' % ( + self._respond_error('901: Internal error on command: "%s", error: "%s\n"' % ( origline, str(e))) self.printer.send_event("gcode:command_error") if not need_ack: raise except: - msg = 'Internal error on command:"%s", origline"%s"' % ( + msg = '9015: Internal error on command:"%s", origline"%s"' % ( cmd, origline) logging.exception(msg) self.printer.invoke_shutdown(msg) @@ -255,7 +255,7 @@ def _respond_state(self, state): def _get_extended_params(self, gcmd): m = self.extended_r.match(gcmd.get_commandline()) if m is None: - raise self.error("Malformed command '%s'" + raise self.error("902: Malformed command '%s'" % (gcmd.get_commandline(),)) eargs = m.group('args') try: @@ -265,7 +265,7 @@ def _get_extended_params(self, gcmd): gcmd._params.update(eparams) return gcmd except ValueError as e: - raise self.error("Malformed command '%s'" + raise self.error("902: Malformed command '%s'" % (gcmd.get_commandline(),)) # G-Code special command handlers def cmd_default(self, gcmd): @@ -278,7 +278,7 @@ def cmd_default(self, gcmd): # Don't warn about sd card init when not ready return if not self.is_printer_ready: - raise gcmd.error(self.printer.get_state_message()[0]) + raise gcmd.error("904: %s" % self.printer.get_state_message()[0]) return if not cmd: cmdline = gcmd.get_commandline() @@ -298,7 +298,7 @@ def cmd_default(self, gcmd): not gcmd.get_float('S', 1.) or self.is_fileinput)): # Don't warn about requests to turn off fan when fan not present return - gcmd.respond_warning('Unknown command:"%s"' % (cmd,)) + gcmd.respond_warning('911: Unknown command:"%s"' % (cmd,)) def _cmd_mux(self, command, gcmd): key, values = self.mux_commands[command] if None in values: @@ -306,7 +306,7 @@ def _cmd_mux(self, command, gcmd): else: key_param = gcmd.get(key) if key_param not in values: - raise gcmd.error("The value '%s' is not valid for %s" + raise gcmd.error("905: The value '%s' is not valid for %s" % (key_param, key)) values[key_param](gcmd) # Low-level G-Code commands that are needed before the config file is loaded @@ -347,7 +347,7 @@ def cmd_STATUS(self, gcmd): if self.is_printer_ready: self._respond_state("Ready") return - msg = self.printer.get_state_message()[0] + msg = "906: %s" % self.printer.get_state_message()[0] msg = msg.rstrip() + "\nKlipper state: Not ready" raise gcmd.error(msg) cmd_HELP_help = "Report the list of available extended G-Code commands" diff --git a/klippy/kinematics/cartesian_6axis.py b/klippy/kinematics/cartesian_6axis.py index cdd250ef0bf4..daabed846cbd 100644 --- a/klippy/kinematics/cartesian_6axis.py +++ b/klippy/kinematics/cartesian_6axis.py @@ -111,8 +111,8 @@ def _check_endstops(self, move): and (end_pos[i] < self.limits[i][0] or end_pos[i] > self.limits[i][1])): if self.limits[i][0] > self.limits[i][1]: - raise move.move_error("Must home axis first") - raise move.move_error() + raise move.move_error("1019: Must home axis first") + raise move.move_error("1019: ") def check_move(self, move): limits = self.limits diff --git a/klippy/kinematics/corexy_6axis.py b/klippy/kinematics/corexy_6axis.py index 7df655d054ee..975fdfb5ae93 100644 --- a/klippy/kinematics/corexy_6axis.py +++ b/klippy/kinematics/corexy_6axis.py @@ -92,8 +92,8 @@ def _check_endstops(self, move): and (end_pos[i] < self.limits[i][0] or end_pos[i] > self.limits[i][1])): if self.limits[i][0] > self.limits[i][1]: - raise move.move_error("Must home axis first") - raise move.move_error() + raise move.move_error("1019: Must home axis first") + raise move.move_error("1019: ") def check_move(self, move): limits = self.limits diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index 27fd09c00730..3c789847ce7b 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -67,7 +67,7 @@ def sync_to_extruder(self, extruder_name): return extruder = self.printer.lookup_object(extruder_name, None) if extruder is None or not isinstance(extruder, PrinterExtruder): - raise self.printer.command_error("'%s' is not a valid extruder." + raise self.printer.command_error("601: '%s' is not a valid extruder." % (extruder_name,)) self.stepper.set_position([extruder.last_position, 0., 0., 0., 0.]) self.stepper.set_trapq(extruder.get_trapq()) @@ -91,10 +91,10 @@ def _set_pressure_advance(self, pressure_advance, smooth_time): def cmd_default_SET_PRESSURE_ADVANCE(self, gcmd): extruder = self.printer.lookup_object('toolhead').get_extruder() if extruder.extruder_stepper is None: - raise gcmd.error("Active extruder does not have a stepper") + raise gcmd.error("602: Active extruder does not have a stepper") strapq = extruder.extruder_stepper.stepper.get_trapq() if strapq is not extruder.get_trapq(): - raise gcmd.error("Unable to infer active extruder stepper") + raise gcmd.error("603: Unable to infer active extruder stepper") extruder.extruder_stepper.cmd_SET_PRESSURE_ADVANCE(gcmd) def cmd_SET_PRESSURE_ADVANCE(self, gcmd): pressure_advance = gcmd.get_float('ADVANCE', self.pressure_advance, @@ -113,7 +113,7 @@ def cmd_SET_E_ROTATION_DISTANCE(self, gcmd): rotation_dist = gcmd.get_float('DISTANCE', None) if rotation_dist is not None: if not rotation_dist: - raise gcmd.error("Rotation distance can not be zero") + raise gcmd.error("604: Rotation distance can not be zero") invert_dir, orig_invert_dir = self.stepper.get_dir_inverted() next_invert_dir = orig_invert_dir if rotation_dist < 0.: @@ -240,14 +240,14 @@ def check_move(self, move): axis_r = move.axes_r[5] if not self.heater.can_extrude: raise self.printer.command_error( - "Extrude below minimum temp\n" + "605: Extrude below minimum temp\n" "See the 'min_extrude_temp' config option for details") if (not move.axes_d[0] and not move.axes_d[1] and not move.axes_d[2] and not move.axes_d[3] and not move.axes_d[4]) or axis_r < 0.: # Extrude only move (or retraction move) - limit accel and velocity if abs(move.axes_d[5]) > self.max_e_dist: raise self.printer.command_error( - "Extrude only move too long (%.3fmm vs %.3fmm)\n" + "606: Extrude only move too long (%.3fmm vs %.3fmm)\n" "See the 'max_extrude_only_distance' config" " option for details" % (move.axes_d[5], self.max_e_dist)) inv_extrude_r = 1. / abs(axis_r) @@ -261,7 +261,7 @@ def check_move(self, move): logging.debug("Overextrude: %s vs %s (area=%.3f dist=%.3f)", axis_r, self.max_extrude_ratio, area, move.move_d) raise self.printer.command_error( - "Move exceeds maximum extrusion (%.3fmm^2 vs %.3fmm^2)\n" + "607: Move exceeds maximum extrusion (%.3fmm^2 vs %.3fmm^2)\n" "See the 'max_extrude_cross_section' config option for details" % (area, self.max_extrude_ratio * self.filament_area)) @@ -304,7 +304,7 @@ def cmd_M104(self, gcmd, wait=False): if extruder is None: if temp <= 0.: return - raise gcmd.error("Extruder not configured") + raise gcmd.error("608: Extruder not configured") else: extruder = self.printer.lookup_object('toolhead').get_extruder() pheaters = self.printer.lookup_object('heaters') @@ -335,7 +335,7 @@ def update_move_time(self, flush_time): pass def check_move(self, move): - raise move.move_error("Extrude when no extruder present") + raise move.move_error("609: Extrude when no extruder present") def find_past_position(self, print_time): return 0. @@ -347,10 +347,10 @@ def get_name(self): return "" def get_heater(self): - raise self.printer.command_error("Extruder not configured") + raise self.printer.command_error("6010: Extruder not configured") def get_trapq(self): - raise self.printer.command_error("Extruder not configured") + raise self.printer.command_error("6011: Extruder not configured") def add_printer_objects(config): diff --git a/klippy/klippy.py b/klippy/klippy.py index 8f2caf3b5222..cbf8579789e2 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -88,13 +88,13 @@ def _set_state(self, msg): def add_object(self, name, obj): if name in self.objects: raise self.config_error( - "Printer object '%s' already created" % (name,)) + "009: Printer object '%s' already created" % (name,)) self.objects[name] = obj def lookup_object(self, name, default=configfile.sentinel): if name in self.objects: return self.objects[name] if default is configfile.sentinel: - raise self.config_error("Unknown config object '%s'" % (name,)) + raise self.config_error("0010: Unknown config object '%s'" % (name,)) return default def lookup_objects(self, module=None): if module is None: @@ -117,7 +117,7 @@ def load_object(self, config, section, default=configfile.sentinel): if not os.path.exists(py_name) and not os.path.exists(py_dirname): if default is not configfile.sentinel: return default - raise self.config_error("Unable to load module '%s'" % (section,)) + raise self.config_error("0011: Unable to load module '%s'" % (section,)) mod = importlib.import_module('extras.' + module_name) init_func = 'load_config' if len(module_parts) > 1: @@ -126,7 +126,7 @@ def load_object(self, config, section, default=configfile.sentinel): if init_func is None: if default is not configfile.sentinel: return default - raise self.config_error("Unable to load module '%s'" % (section,)) + raise self.config_error("0011: Unable to load module '%s'" % (section,)) self.objects[section] = init_func(config.getsection(section)) return self.objects[section] def _read_config(self): diff --git a/klippy/mathutil.py b/klippy/mathutil.py index 9e20e7ab10cf..875b751d0bed 100644 --- a/klippy/mathutil.py +++ b/klippy/mathutil.py @@ -83,7 +83,7 @@ def wrapper(): # Return results is_err, res = parent_conn.recv() if is_err: - raise Exception("Error in coordinate descent: %s" % (res,)) + raise Exception("802: Error in coordinate descent: %s" % (res,)) calc_proc.join() parent_conn.close() return res diff --git a/klippy/mcu.py b/klippy/mcu.py index 76c70506ba4a..b4535d596e28 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -42,7 +42,7 @@ def get_response(self, cmds, cmd_queue, minclock=0, reqclock=0): query_time = self.reactor.monotonic() if query_time > first_query_time + self.TIMEOUT_TIME: self.serial.register_response(None, self.name, self.oid) - raise serialhdl.error("Timeout on wait for '%s' response" + raise serialhdl.error("301: Timeout on wait for '%s' response" % (self.name,)) self.serial.raw_send(cmd, minclock, minclock, cmd_queue) @@ -68,7 +68,7 @@ def _do_send(self, cmds, minclock, reqclock): try: return xh.get_response(cmds, self._cmd_queue, minclock, reqclock) except serialhdl.error as e: - raise self._error(str(e)) + raise self._error("302: %s" % str(e)) def send(self, data=(), minclock=0, reqclock=0): return self._do_send([self._cmd.encode(data)], minclock, reqclock) def send_with_preface(self, preface_cmd, preface_data=(), data=(), @@ -249,7 +249,7 @@ def add_stepper(self, stepper): for s in ot.get_steppers(): if ot is not trsync and s.get_name().startswith(sname[:9]): cerror = self._mcu.get_printer().config_error - raise cerror("Multi-mcu homing not supported on" + raise cerror("303: Multi-mcu homing not supported on" " multi-mcu shared axis") def get_steppers(self): return [s for trsync in self._trsyncs for s in trsync.get_steppers()] @@ -480,7 +480,7 @@ def set_pwm(self, print_time, value, cycle_time=None): if cycle_ticks != self._last_cycle_ticks: if cycle_ticks >= 1<<31: raise self._mcu.get_printer().command_error( - "PWM cycle time too large") + "3012: PWM cycle time too large") self._set_cycle_ticks.send([self._oid, cycle_ticks], minclock=minclock, reqclock=clock) self._last_cycle_ticks = cycle_ticks @@ -656,7 +656,7 @@ def _check_restart(self, reason): self._name, reason) self._printer.request_exit('firmware_restart') self._reactor.pause(self._reactor.monotonic() + 2.000) - raise error("Attempt MCU '%s' restart failed" % (self._name,)) + raise error("3013: Attempt MCU '%s' restart failed" % (self._name,)) def _connect_file(self, pace=False): # In a debugging mode. Open debug output file and read data dictionary start_args = self._printer.get_start_args() @@ -696,7 +696,7 @@ def _send_config(self, prev_crc): self.add_config_cmd("finalize_config crc=%d" % (config_crc,)) if prev_crc is not None and config_crc != prev_crc: self._check_restart("CRC mismatch") - raise error("MCU '%s' CRC does not match config" % (self._name,)) + raise error("3013: MCU '%s' CRC does not match config" % (self._name,)) # Transmit config messages (if needed) self.register_response(self._handle_starting, 'starting') try: @@ -716,7 +716,7 @@ def _send_config(self, prev_crc): if enum_name == 'pin': # Raise pin name errors as a config error (not a protocol error) raise self._printer.config_error( - "Pin '%s' is not a valid pin name on mcu '%s'" + "305: Pin '%s' is not a valid pin name on mcu '%s'" % (enum_value, self._name)) raise def _send_get_config(self): @@ -727,10 +727,10 @@ def _send_get_config(self): return { 'is_config': 0, 'move_count': 500, 'crc': 0 } config_params = get_config_cmd.send() if self._is_shutdown: - raise error("MCU '%s' error during config: %s" % ( + raise error("3014: MCU '%s' error during config: %s" % ( self._name, self._shutdown_msg)) if config_params['is_shutdown']: - raise error("Can not update MCU '%s' config as it is shutdown" % ( + raise error("3013: Can not update MCU '%s' config as it is shutdown" % ( self._name,)) return config_params def _log_info(self): @@ -753,18 +753,18 @@ def _connect(self): self._send_config(None) config_params = self._send_get_config() if not config_params['is_config'] and not self.is_fileoutput(): - raise error("Unable to configure MCU '%s'" % (self._name,)) + raise error("3015: Unable to configure MCU '%s'" % (self._name,)) else: start_reason = self._printer.get_start_args().get("start_reason") if start_reason == 'firmware_restart': - raise error("Failed automated reset of MCU '%s'" + raise error("3016: Failed automated reset of MCU '%s'" % (self._name,)) # Already configured - send init commands self._send_config(config_params['crc']) # Setup steppersync with the move_count returned by get_config move_count = config_params['move_count'] if move_count < self._reserved_move_slots: - raise error("Too few moves available on MCU '%s'" % (self._name,)) + raise error("3017: Too few moves available on MCU '%s'" % (self._name,)) ffi_main, ffi_lib = chelper.get_ffi() self._steppersync = ffi_main.gc( ffi_lib.steppersync_alloc(self._serial.get_serialqueue(), @@ -800,7 +800,7 @@ def _mcu_identify(self): self._serial.connect_pipe(self._serialport) self._clocksync.connect(self._serial) except serialhdl.error as e: - raise error(str(e)) + raise error("3018: %s" % str(e)) logging.info(self._log_info()) ppins = self._printer.lookup_object('pins') pin_resolver = ppins.get_pin_resolver(self._name) @@ -964,7 +964,7 @@ def flush_moves(self, print_time): return ret = self._ffi_lib.steppersync_flush(self._steppersync, clock) if ret: - raise error("Internal error in MCU '%s' stepcompress" + raise error("3020: Internal error in MCU '%s' stepcompress" % (self._name,)) def check_active(self, print_time, eventtime): if self._steppersync is None: diff --git a/klippy/msgproto.py b/klippy/msgproto.py index f8a12530e67e..c4d927cc38c7 100644 --- a/klippy/msgproto.py +++ b/klippy/msgproto.py @@ -88,7 +88,7 @@ class enumeration_error(error): def __init__(self, enum_name, value): self.enum_name = enum_name self.value = value - error.__init__(self, "Unknown value '%s' in enumeration '%s'" + error.__init__(self, "806: Unknown value '%s' in enumeration '%s'" % (value, enum_name)) def get_enum_params(self): return self.enum_name, self.value @@ -149,7 +149,7 @@ def lookup_output_params(msgformat): param_types.append(t) break else: - raise error("Invalid output format for '%s'" % (msgformat,)) + raise error("806: Invalid output format for '%s'" % (msgformat,)) args = args[pos+1:] return param_types @@ -227,7 +227,7 @@ def format_params(self, params): class MessageParser: error = error - def __init__(self, warn_prefix=""): + def __init__(self, warn_prefix="806: "): self.warn_prefix = warn_prefix self.unknown = UnknownFormat() self.enumerations = {} diff --git a/klippy/pins.py b/klippy/pins.py index 35fc58a255a3..c9179aad0b26 100644 --- a/klippy/pins.py +++ b/klippy/pins.py @@ -23,15 +23,15 @@ def __init__(self, validate_aliases=True): self.active_pins = {} def reserve_pin(self, pin, reserve_name): if pin in self.reserved and self.reserved[pin] != reserve_name: - raise error("Pin %s reserved for %s - can't reserve for %s" % ( + raise error("304: Pin %s reserved for %s - can't reserve for %s" % ( pin, self.reserved[pin], reserve_name)) self.reserved[pin] = reserve_name def alias_pin(self, alias, pin): if alias in self.aliases and self.aliases[alias] != pin: - raise error("Alias %s mapped to %s - can't alias to %s" % ( + raise error("304: Alias %s mapped to %s - can't alias to %s" % ( alias, self.aliases[alias], pin)) if [c for c in '^~!:' if c in pin] or ''.join(pin.split()) != pin: - raise error("Invalid pin alias '%s'\n" % (pin,)) + raise error("304: Invalid pin alias '%s'\n" % (pin,)) if pin in self.aliases: pin = self.aliases[pin] self.aliases[alias] = pin @@ -44,10 +44,10 @@ def pin_fixup(m): pin_id = self.aliases.get(name, name) if (name != self.active_pins.setdefault(pin_id, name) and self.validate_aliases): - raise error("pin %s is an alias for %s" % ( + raise error("304: pin %s is an alias for %s" % ( name, self.active_pins[pin_id])) if pin_id in self.reserved: - raise error("pin %s is reserved for %s" % ( + raise error("304: pin %s is reserved for %s" % ( name, self.reserved[pin_id])) return m.group('prefix') + str(pin_id) return re_pin.sub(pin_fixup, cmd) @@ -80,14 +80,14 @@ def parse_pin(self, pin_desc, can_invert=False, can_pullup=False): else: chip_name, pin = [s.strip() for s in desc.split(':', 1)] if chip_name not in self.chips: - raise error("Unknown pin chip name '%s'" % (chip_name,)) + raise error("304: Unknown pin chip name '%s'" % (chip_name,)) if [c for c in '^~!:' if c in pin] or ''.join(pin.split()) != pin: format = "" if can_pullup: format += "[^~] " if can_invert: format += "[!] " - raise error("Invalid pin description '%s'\n" + raise error("304: Invalid pin description '%s'\n" "Format is: %s[chip_name:] pin_name" % ( pin_desc, format)) pin_params = {'chip': self.chips[chip_name], 'chip_name': chip_name, @@ -103,10 +103,10 @@ def lookup_pin(self, pin_desc, can_invert=False, can_pullup=False, if share_name in self.allow_multi_use_pins: pass elif share_type is None or share_type != share_params['share_type']: - raise error("pin %s used multiple times in config" % (pin,)) + raise error("304: pin %s used multiple times in config" % (pin,)) elif (pin_params['invert'] != share_params['invert'] or pin_params['pullup'] != share_params['pullup']): - raise error("Shared pin %s must have same polarity" % (pin,)) + raise error("304: Shared pin %s must have same polarity" % (pin,)) return share_params pin_params['share_type'] = share_type self.active_pins[share_name] = pin_params @@ -121,12 +121,12 @@ def reset_pin_sharing(self, pin_params): del self.active_pins[share_name] def get_pin_resolver(self, chip_name): if chip_name not in self.pin_resolvers: - raise error("Unknown chip name '%s'" % (chip_name,)) + raise error("304: Unknown chip name '%s'" % (chip_name,)) return self.pin_resolvers[chip_name] def register_chip(self, chip_name, chip): chip_name = chip_name.strip() if chip_name in self.chips: - raise error("Duplicate chip name '%s'" % (chip_name,)) + raise error("304: Duplicate chip name '%s'" % (chip_name,)) self.chips[chip_name] = chip self.pin_resolvers[chip_name] = PinResolver() def allow_multi_use_pin(self, pin_desc): diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py index 0285799385fb..d22d000b8bb6 100644 --- a/klippy/serialhdl.py +++ b/klippy/serialhdl.py @@ -12,7 +12,7 @@ class error(Exception): pass class SerialReader: - def __init__(self, reactor, warn_prefix=""): + def __init__(self, reactor, warn_prefix="807: "): self.reactor = reactor self.warn_prefix = warn_prefix # Serial port @@ -323,7 +323,7 @@ def get_response(self, cmds, cmd_queue, minclock=0, reqclock=0): return params if retries <= 0: self.serial.register_response(None, self.name, self.oid) - raise error("Unable to obtain '%s' response" % (self.name,)) + raise error("808: Unable to obtain '%s' response" % (self.name,)) reactor = self.serial.reactor reactor.pause(reactor.monotonic() + retry_delay) retries -= 1 diff --git a/klippy/stepper.py b/klippy/stepper.py index e4d3db8e0c07..3769e2870fe5 100644 --- a/klippy/stepper.py +++ b/klippy/stepper.py @@ -38,7 +38,7 @@ def __init__(self, name, step_pin_params, dir_pin_params, self._invert_step = step_pin_params['invert'] if dir_pin_params['chip'] is not self._mcu: raise self._mcu.get_printer().config_error( - "Stepper dir pin must be on same mcu as step pin") + "306: Stepper dir pin must be on same mcu as step pin") self._dir_pin = dir_pin_params['pin'] self._invert_dir = self._orig_invert_dir = dir_pin_params['invert'] self._step_both_edge = self._req_step_both_edge = False @@ -203,11 +203,11 @@ def note_homing_end(self): ffi_main, ffi_lib = chelper.get_ffi() ret = ffi_lib.stepcompress_reset(self._stepqueue, 0) if ret: - raise error("Internal error in stepcompress") + raise error("307: Internal error in stepcompress") data = (self._reset_cmd_tag, self._oid, 0) ret = ffi_lib.stepcompress_queue_msg(self._stepqueue, data, len(data)) if ret: - raise error("Internal error in stepcompress") + raise error("308: Internal error in stepcompress") self._query_mcu_position() def _query_mcu_position(self): @@ -223,7 +223,7 @@ def _query_mcu_position(self): ret = ffi_lib.stepcompress_set_last_position(self._stepqueue, clock, last_pos) if ret: - raise error("Internal error in stepcompress") + raise error("309: Internal error in stepcompress") self._set_mcu_position(last_pos) self._mcu.get_printer().send_event("stepper:sync_mcu_position", self) def get_trapq(self): @@ -254,7 +254,7 @@ def generate_steps(self, flush_time): sk = self._stepper_kinematics ret = self._itersolve_generate_steps(sk, flush_time) if ret: - raise error("Internal error in stepcompress") + raise error("3010: Internal error in stepcompress") def is_active_axis(self, axis): ffi_main, ffi_lib = chelper.get_ffi() @@ -314,7 +314,7 @@ def parse_step_distance(config, units_in_radians=None, note_valid=False): full_steps = config.getint('full_steps_per_rotation', 200, minval=1, note_valid=note_valid) if full_steps % 4: - raise config.error("full_steps_per_rotation invalid in section '%s'" + raise config.error("3011: full_steps_per_rotation invalid in section '%s'" % (config.get_name(),)) gearing = parse_gear_ratio(config, note_valid) return rotation_dist, full_steps * microsteps * gearing @@ -364,7 +364,7 @@ def __init__(self, config, need_position_minmax=True, if (self.position_endstop < self.position_min or self.position_endstop > self.position_max): raise config.error( - "position_endstop in section '%s' must be between" + "3021: position_endstop in section '%s' must be between" " position_min and position_max" % config.get_name()) else: self.position_min = -sys.float_info.max # float('-inf') @@ -389,7 +389,7 @@ def __init__(self, config, need_position_minmax=True, self.homing_positive_dir = True else: raise config.error( - "Unable to infer homing_positive_dir in section '%s'" + "3022: Unable to infer homing_positive_dir in section '%s'" % (config.get_name(),)) config.getboolean('homing_positive_dir', self.homing_positive_dir) elif ((self.homing_positive_dir @@ -397,7 +397,7 @@ def __init__(self, config, need_position_minmax=True, or (not self.homing_positive_dir and self.position_endstop == self.position_max)): raise config.error( - "Invalid homing_positive_dir / position_endstop in '%s'" + "3023: Invalid homing_positive_dir / position_endstop in '%s'" % (config.get_name(),)) def get_range(self): @@ -449,7 +449,7 @@ def add_extra_stepper(self, config): changed_invert = pin_params['invert'] != endstop['invert'] changed_pullup = pin_params['pullup'] != endstop['pullup'] if changed_invert or changed_pullup: - raise error("Pinter rail %s shared endstop pin %s " + raise error("3023: Pinter rail %s shared endstop pin %s " "must specify the same pullup/invert settings" % (self.get_name(), pin_name)) mcu_endstop.add_stepper(stepper) diff --git a/klippy/toolhead.py b/klippy/toolhead.py index b9a51219e7d8..cf572804d6a2 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -290,7 +290,7 @@ def __init__(self, config): except self.printer.lookup_object('pins').error as e: raise except: - msg = "Error loading kinematics '%s'" % (kin_name,) + msg = "0015: Error loading kinematics '%s'" % (kin_name,) logging.exception(msg) raise config.error(msg) # Register commands diff --git a/klippy/webhooks.py b/klippy/webhooks.py index 43ff9a914e62..36c9a4782c76 100644 --- a/klippy/webhooks.py +++ b/klippy/webhooks.py @@ -44,12 +44,12 @@ def __init__(self, client_conn, request): self.client_conn = client_conn base_request = json.loads(request, object_hook=json_loads_byteify) if type(base_request) != dict: - raise ValueError("Not a top-level dictionary") + raise ValueError("701: Not a top-level dictionary") self.id = base_request.get('id', None) self.method = base_request.get('method') self.params = base_request.get('params', {}) if type(self.method) != str or type(self.params) != dict: - raise ValueError("Invalid request type") + raise ValueError("702: Invalid request type") self.response = None self.is_error = False @@ -59,10 +59,10 @@ def get_client_connection(self): def get(self, item, default=Sentinel, types=None): value = self.params.get(item, default) if value is Sentinel: - raise WebRequestError("Missing Argument [%s]" % (item,)) + raise WebRequestError("703: Missing Argument [%s]" % (item,)) if (types is not None and type(value) not in types and item in self.params): - raise WebRequestError("Invalid Argument Type [%s]" % (item,)) + raise WebRequestError("704: Invalid Argument Type [%s]" % (item,)) return value def get_str(self, item, default=Sentinel): @@ -86,7 +86,7 @@ def set_error(self, error): def send(self, data): if self.response is not None: - raise WebRequestError("Multiple calls to send not allowed") + raise WebRequestError("705: Multiple calls to send not allowed") self.response = data def finish(self): @@ -155,7 +155,7 @@ def _remove_socket_file(self, file_path): except OSError: if os.path.exists(file_path): logging.exception( - "webhooks: Unable to delete socket file '%s'" + "706: webhooks: Unable to delete socket file '%s'" % (file_path)) raise @@ -308,7 +308,7 @@ def __init__(self, printer): def register_endpoint(self, path, callback): if path in self._endpoints: - raise WebRequestError("Path already registered to an endpoint") + raise WebRequestError("707: Path already registered to an endpoint") self._endpoints[path] = callback def register_mux_endpoint(self, path, key, value, callback): @@ -319,11 +319,11 @@ def register_mux_endpoint(self, path, key, value, callback): prev_key, prev_values = prev if prev_key != key: raise self.printer.config_error( - "mux endpoint %s %s %s may have only one key (%s)" + "708: mux endpoint %s %s %s may have only one key (%s)" % (path, key, value, prev_key)) if value in prev_values: raise self.printer.config_error( - "mux endpoint %s %s %s already registered (%s)" + "709: mux endpoint %s %s %s already registered (%s)" % (path, key, value, prev_values)) prev_values[value] = callback @@ -334,7 +334,7 @@ def _handle_mux(self, web_request): else: key_param = web_request.get(key) if key_param not in values: - raise web_request.error("The value '%s' is not valid for %s" + raise web_request.error("7010: The value '%s' is not valid for %s" % (key_param, key)) values[key_param](web_request) @@ -373,7 +373,7 @@ def get_connection(self): def get_callback(self, path): cb = self._endpoints.get(path, None) if cb is None: - msg = "webhooks: No registered callback for path '%s'" % (path) + msg = "7011: webhooks: No registered callback for path '%s'" % (path) logging.info(msg) raise WebRequestError(msg) return cb @@ -388,7 +388,7 @@ def stats(self, eventtime): def call_remote_method(self, method, **kwargs): if method not in self._remote_methods: raise self.printer.command_error( - "Remote method '%s' not registered" % (method)) + "7012: Remote method '%s' not registered" % (method)) conn_map = self._remote_methods[method] valid_conns = {} for conn, template in conn_map.items(): @@ -400,7 +400,7 @@ def call_remote_method(self, method, **kwargs): if not valid_conns: del self._remote_methods[method] raise self.printer.command_error( - "No active connections for method '%s'" % (method)) + "7013: No active connections for method '%s'" % (method)) self._remote_methods[method] = valid_conns class GCodeHelper: @@ -512,11 +512,11 @@ def _handle_query(self, web_request, is_subscribe=False): # Validate subscription format for k, v in objects.items(): if type(k) != str or (v is not None and type(v) != list): - raise web_request.error("Invalid argument") + raise web_request.error("7014: Invalid argument") if v is not None: for ri in v: if type(ri) != str: - raise web_request.error("Invalid argument") + raise web_request.error("7015: Invalid argument") # Add to pending queries cconn = web_request.get_client_connection() template = web_request.get_dict('response_template', {}) diff --git a/stereotech_config/diagnostics.cfg b/stereotech_config/diagnostics.cfg index 881b103fdaba..42ffdf918818 100644 --- a/stereotech_config/diagnostics.cfg +++ b/stereotech_config/diagnostics.cfg @@ -102,7 +102,7 @@ gcode: {% set heater = params.HEATER|default('extruder')|lower %} {% set temp = params.TEMP|default(100)|float %} {% if printer["gcode_button five_axis_module"].state == "PRESSED" and heater == "heater_bed" %} - {action_raise_error("3D module disabled, cannot set temperature for heater 'heater_bed'.")} + {action_raise_error("501: 3D module disabled, cannot set temperature for heater 'heater_bed'.")} {% else %} SET_HEATER_TEMPERATURE HEATER={heater} TARGET={temp} TEMPERATURE_WAIT SENSOR={heater} MINIMUM={temp} MAXIMUM={temp + 2} @@ -150,7 +150,7 @@ gcode: {% endif %} T0 # return to main state {% else %} - {action_raise_error("Extruder '%s' not connected." % extruder)} + {action_raise_error("502: Extruder '%s' not connected." % extruder)} {% endif %} [gcode_macro CHECK_FAN] diff --git a/stereotech_config/ender/homing.cfg b/stereotech_config/ender/homing.cfg index c33dc5211dee..60f2373406a7 100644 --- a/stereotech_config/ender/homing.cfg +++ b/stereotech_config/ender/homing.cfg @@ -84,12 +84,12 @@ gcode: # {% if printer[printer.toolhead.extruder].can_extrude|lower == 'true' %} # G1 E-{e} F1200 # {% else %} -# {action_respond_warning("Extruder not hot enough")} +# {action_respond_warning("611: Extruder not hot enough")} # {% endif %} # {% if "xyz" in printer.toolhead.homed_axes %} # G1 Z{z_safe} F3600 # G90 # G1 X{x} Y{y} F3600 # {% else %} -# {action_respond_warning("Printer not homed")} +# {action_respond_warning("813: Printer not homed")} # {% endif %} diff --git a/stereotech_config/ender/print_macros.cfg b/stereotech_config/ender/print_macros.cfg index 2064689ddbc7..d89529c54f70 100644 --- a/stereotech_config/ender/print_macros.cfg +++ b/stereotech_config/ender/print_macros.cfg @@ -40,14 +40,14 @@ gcode: {% if printer[printer.toolhead.extruder].can_extrude|lower == 'true' %} G1 E-{e} F1200 {% else %} - {action_respond_warning("Extruder not hot enough")} + {action_respond_warning("611: Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F3600 G90 G1 X{x} Y{y} F3600 {% else %} - {action_respond_warning("Printer not homed")} + {action_respond_warning("814: Printer not homed")} {% endif %} M106 S0 @@ -65,7 +65,7 @@ gcode: {% if printer[printer.toolhead.extruder].can_extrude|lower == 'true' %} G1 E{e} F1800 {% else %} - {action_respond_warning("Extruder not hot enough")} + {action_respond_warning("611: Extruder not hot enough")} {% endif %} G90 SET_IDLE_TIMEOUT TIMEOUT=600 diff --git a/stereotech_config/ender/probe.cfg b/stereotech_config/ender/probe.cfg index 6e7a392d424e..4ced317536ac 100644 --- a/stereotech_config/ender/probe.cfg +++ b/stereotech_config/ender/probe.cfg @@ -268,11 +268,11 @@ z_offset: 0.0 # {% set home_min = printer.toolhead.axis_minimum %} # {% set home_max = printer.toolhead.axis_maximum %} # {% if x < home_min[0] or x > home_max[0] %} -# {action_raise_error('axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} +# {action_raise_error('201: axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} # {% elif y < home_min[1] or y > home_max[1] %} -# {action_raise_error('axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} +# {action_raise_error('202: axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} # {% elif z < home_min[2] or z > home_max[2] %} -# {action_raise_error('axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} +# {action_raise_error('203: axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} # {% endif %} # {% set index = params.POINT|default(0) %} # SAVE_WCS_CALC_POINT POINT={index} COORDS='{x},{y},{z}' diff --git a/stereotech_config/filament_control.cfg b/stereotech_config/filament_control.cfg index 6c347bb003d0..e34638a518e1 100644 --- a/stereotech_config/filament_control.cfg +++ b/stereotech_config/filament_control.cfg @@ -37,9 +37,9 @@ gcode: [gcode_macro FILAMENT_ERROR] gcode: {% if params.EXTRUDER == 'extruder' %} - {action_raise_error('Filament error on Extruder 1')} + {action_raise_error('401: Filament error on Extruder0')} {% else %} - {action_raise_error('Filament error on Extruder 2')} + {action_raise_error('402: Filament error on Extruder1')} {% endif %} [gcode_macro SET_FILAMENT_SENSOR] diff --git a/stereotech_config/filament_control_2.cfg b/stereotech_config/filament_control_2.cfg index 4eb354653073..6bc81265888a 100644 --- a/stereotech_config/filament_control_2.cfg +++ b/stereotech_config/filament_control_2.cfg @@ -7,7 +7,7 @@ pause_on_runout: False runout_gcode: {% if printer.virtual_sdcard.is_active %} M117 trigered_filament_sensor0 - {action_respond_warning('The filament has run out or there is a problem with its supply at the Extruder0.')} + {action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder0.')} RECOVER_EXTRUSION SENSOR='extruder_sensor' {% else %} FILAMENT_ERROR EXTRUDER=extruder @@ -16,9 +16,9 @@ runout_gcode: [gcode_macro FILAMENT_ERROR] gcode: {% if params.EXTRUDER == 'extruder' %} - {action_raise_error('Filament error on Extruder 1')} + {action_raise_error('401: Filament error on Extruder0')} {% else %} - {action_raise_error('Filament error on Extruder 2')} + {action_raise_error('402: Filament error on Extruder1')} {% endif %} [gcode_macro SET_FILAMENT_SENSOR] @@ -48,7 +48,7 @@ gcode: {% else %} SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=count_trigered_sensor VALUE={printer["gcode_macro RECOVER_EXTRUSION"].count_trigered_sensor + 1} {% if printer.print_stats.info.current_layer == 0 and printer["gcode_macro RECOVER_EXTRUSION"].enable_offset and printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made < printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].check_count %} - {action_respond_warning('Recover extrusion by offset %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made)} + {action_respond_warning('412: Recover extrusion by offset %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made)} RECOVER_EXTRUSION_BY_OFFSET SENSOR={sensor} {% else %} {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_offset %} @@ -69,12 +69,12 @@ gcode: RECOVER_EXTRUSION_BY_SECOND_EXTRUDER {% else %} {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_second_extruder and sensor == 'extruder_sensor' %} - {action_respond_warning('Switch to second extruder and resume printing.')} + {action_respond_warning('413: Switch to second extruder and resume printing.')} RECOVER_EXTRUSION_BY_SECOND_EXTRUDER RESET=1 SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_second_extruder VALUE=0 {% endif %} #Set timeout and wait for user - {action_respond_warning('All attempt to extrude failed.')} + {action_respond_warning('414: All attempt to extrude failed.')} M117 all_attempt_extrude_failed UPDATE_DELAYED_GCODE ID=TURN_OFF_EXTRUDERS_DELAYED DURATION=300 SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_offset VALUE=1 @@ -127,7 +127,7 @@ gcode: {% else %} {% if printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].use_cooldown and printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made >= printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].check_count %} {% set extruder_temp = printer["gcode_macro PAUSE"].extruder_temp if extruder == 'extruder' else printer["gcode_macro PAUSE"].extruder1_temp %} - {action_respond_warning('Recover extrusion after cooling and heating.')} + {action_respond_warning('415: Recover extrusion after cooling and heating.')} M106 S255 M109 S50 M107 @@ -141,7 +141,7 @@ gcode: SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=use_cooldown VALUE=0 CHECK_FILAMENT_MOTION_SENSOR SENSOR={sensor} {% else %} - {action_respond_warning('Recover extrusion do extrude attempt %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made)} + {action_respond_warning('416: Recover extrusion do extrude attempt %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made)} M117 try_do_extrude_{printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1} M400 G4 P3000 @@ -159,7 +159,7 @@ gcode: {% set sensor = params.SENSOR %} {% set filament_detected = printer['filament_motion_sensor ' ~ sensor].filament_detected %} {% if filament_detected %} - {action_respond_warning('Extruding attempt completed successfully, resuming printing.')} + {action_respond_warning('417: Extruding attempt completed successfully, resuming printing.')} M117 resume_after_trigered_sensor RESUME {% else %} diff --git a/stereotech_config/filament_control_second.cfg b/stereotech_config/filament_control_second.cfg index 7673caeb148f..e30339e681ab 100644 --- a/stereotech_config/filament_control_second.cfg +++ b/stereotech_config/filament_control_second.cfg @@ -7,7 +7,7 @@ pause_on_runout: False runout_gcode: {% if printer.virtual_sdcard.is_active %} M117 trigered_filament_sensor1 - {action_respond_warning('The filament has run out or there is a problem with its supply at the Extruder2.')} + {action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder2.')} PAUSE TURN_OFF_EXTRUDERS=0 E=0 M400 SET_STATE_TRY_EXTRUDE_FILAMENT SENSOR='extruder1_sensor' ENABLE=1 diff --git a/stereotech_config/filament_control_second_2.cfg b/stereotech_config/filament_control_second_2.cfg index 845f2a3db1b6..8b4115062902 100644 --- a/stereotech_config/filament_control_second_2.cfg +++ b/stereotech_config/filament_control_second_2.cfg @@ -7,7 +7,7 @@ pause_on_runout: False runout_gcode: {% if printer.virtual_sdcard.is_active %} M117 trigered_filament_sensor1 - {action_respond_warning('The filament has run out or there is a problem with its supply at the Extruder2.')} + {action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder2.')} RECOVER_EXTRUSION SENSOR='extruder1_sensor' {% else %} FILAMENT_ERROR EXTRUDER=extruder1 diff --git a/stereotech_config/homing.cfg b/stereotech_config/homing.cfg index 72410e1114a0..33e0dbf163d6 100644 --- a/stereotech_config/homing.cfg +++ b/stereotech_config/homing.cfg @@ -99,12 +99,12 @@ gcode: CUT_FIBER G1 E-{e} F1200 {% else %} - {action_respond_warning("Extruder not hot enough")} + {action_respond_warning("611: Extruder not hot enough.")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F3600 G90 G1 X{x} Y{y} F3600 {% else %} - {action_respond_warning("Printer not homed")} + {action_respond_warning("815: Printer not homed.")} {% endif %} diff --git a/stereotech_config/print_macros.cfg b/stereotech_config/print_macros.cfg index 9f6ef5ab12ff..5be5641ca87a 100644 --- a/stereotech_config/print_macros.cfg +++ b/stereotech_config/print_macros.cfg @@ -16,7 +16,7 @@ gcode: {% else %} {% set x = params.X|default(200) %} {% set y = params.Y|default(10) %} - {% endif %} + {% endif %} {% set z = params.Z|default(50)|float %} {% set e = params.E|default(3) %} {% set turn_off_extruders = params.TURN_OFF_EXTRUDERS|default(1)|int %} @@ -54,7 +54,7 @@ gcode: ;FIVE AXIS COMPENSATION OFF ;B_AXIS_COMPENSATION_VARS ENABLE=0 SET_SKEW ENABLE=0 - RADIAL_SPEED_COMPENSATION ENABLE=0 + RADIAL_SPEED_COMPENSATION ENABLE=0 {% endif %} {% endif %} G54 @@ -63,14 +63,14 @@ gcode: CUT_FIBER G1 E-{e} F1200 {% else %} - {action_respond_warning("Extruder not hot enough")} + {action_respond_warning("611: Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F3600 G90 G1 X{x} Y{y} F3600 {% else %} - {action_respond_warning("Printer not homed")} + {action_respond_warning("813: Printer not homed")} {% endif %} M106 S0 {% else %} @@ -94,7 +94,7 @@ gcode: G1 E{e} F1800 PRIME_FIBER {% else %} - {action_respond_warning("Extruder not hot enough")} + {action_respond_warning("611: Extruder not hot enough")} {% endif %} G90 SET_IDLE_TIMEOUT TIMEOUT=600 diff --git a/stereotech_config/probe.cfg b/stereotech_config/probe.cfg index ecdf091d1ef2..a474270a3526 100644 --- a/stereotech_config/probe.cfg +++ b/stereotech_config/probe.cfg @@ -267,11 +267,11 @@ gcode: {% set home_min = printer.toolhead.axis_minimum %} {% set home_max = printer.toolhead.axis_maximum %} {% if x < home_min[0] or x > home_max[0] %} - {action_raise_error('axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} + {action_raise_error('201: axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} {% elif y < home_min[1] or y > home_max[1] %} - {action_raise_error('axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} + {action_raise_error('202: axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} {% elif z < home_min[2] or z > home_max[2] %} - {action_raise_error('axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} + {action_raise_error('203: axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} {% endif %} {% set index = params.POINT|default(0) %} SAVE_WCS_CALC_POINT POINT={index} COORDS='{x},{y},{z}' @@ -651,7 +651,7 @@ gcode: {% if tool_length > 35.0 %} G10 L2 P3 Z{z - radius} {% else %} - {action_raise_error('%s' % 'Error, tool length not enough for calculate wcs_2_y!')} + {action_raise_error('204: Error, tool length not enough for calculate wcs_2_y!')} {% endif %} {% else %} ; apply measuring for the set wcs_1_z and wcs_2_y(raw). @@ -825,5 +825,5 @@ gcode: G0 X{x} Y{y} F3600 G0 Z{z + radius + 10} F3600 {% else %} - {action_raise_error('%s' % msg)} + {action_raise_error('205: %s' % msg)} {% endif %} diff --git a/stereotech_config/probe_2.cfg b/stereotech_config/probe_2.cfg index b6209ee36907..bb3f709952b6 100644 --- a/stereotech_config/probe_2.cfg +++ b/stereotech_config/probe_2.cfg @@ -243,11 +243,11 @@ gcode: {% set home_min = printer.toolhead.axis_minimum %} {% set home_max = printer.toolhead.axis_maximum %} {% if x < home_min[0] or x > home_max[0] %} - {action_raise_error('axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} + {action_raise_error('201: axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} {% elif y < home_min[1] or y > home_max[1] %} - {action_raise_error('axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} + {action_raise_error('202: axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} {% elif z < home_min[2] or z > home_max[2] %} - {action_raise_error('axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} + {action_raise_error('203: axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} {% endif %} {% set index = params.POINT|default(0) %} SAVE_WCS_CALC_POINT POINT={index} COORDS='{x},{y},{z}' @@ -573,7 +573,7 @@ gcode: {% if tool_length > 35.0 %} G10 L2 P3 Z{z - radius} {% else %} - {action_raise_error('Error, tool length not enough for calculate wcs_2_y!')} + {action_raise_error('204: tool length not enough for calculate wcs_2_y!')} {% endif %} {% elif wcs == 1 %} ; Mode SPIRAL @@ -742,5 +742,5 @@ gcode: G0 X{x} Y{y} F3600 G0 Z{z + radius + 10} F3600 {% else %} - {action_raise_error('%s' % msg)} + {action_raise_error('205: %s' % msg)} {% endif %} diff --git a/stereotech_config/v6/filament_control.cfg b/stereotech_config/v6/filament_control.cfg index ec0c6ec08925..53f8f8570c0c 100644 --- a/stereotech_config/v6/filament_control.cfg +++ b/stereotech_config/v6/filament_control.cfg @@ -6,7 +6,7 @@ # pause_on_runout: False # runout_gcode: # {% if printer.virtual_sdcard.is_active %} -# {action_respond_warning('The filament has run out or there is a problem with its supply at the Extruder 1.')} +# {action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder 1.')} # # PAUSE TURN_OFF_EXTRUDERS=0 E=0 # {% else %} # FILAMENT_ERROR EXTRUDER=extruder @@ -15,7 +15,7 @@ # [gcode_macro FILAMENT_ERROR] # gcode: # {% if params.EXTRUDER == 'extruder' %} -# {action_raise_error('Filament error on Extruder 1')} +# {action_raise_error('401: Filament error on Extruder0')} # {% else %} -# {action_raise_error('Filament error on Extruder 2')} +# {action_raise_error('402: Filament error on Extruder1')} # {% endif %} diff --git a/stereotech_config/v6/filament_control_second.cfg b/stereotech_config/v6/filament_control_second.cfg index 40fe6bfde568..28bd1ed84255 100644 --- a/stereotech_config/v6/filament_control_second.cfg +++ b/stereotech_config/v6/filament_control_second.cfg @@ -6,7 +6,7 @@ # pause_on_runout: False # runout_gcode: # {% if printer.virtual_sdcard.is_active %} -# {action_respond_warning('The filament has run out or there is a problem with its supply at the Extruder 2.')} +# {action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder 2.')} # # PAUSE TURN_OFF_EXTRUDERS=0 E=0 # {% else %} # FILAMENT_ERROR EXTRUDER=extruder1