From 90822be2109ad17eb243ce64f2898c70db88b642 Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Tue, 13 Feb 2024 12:37:40 +0000 Subject: [PATCH 1/6] STEAPP-921: fixed a bug that caused current_step to display incorrectly --- klippy/extras/wizard/wizard.py | 8 +------- klippy/extras/wizard/wizard_step.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/klippy/extras/wizard/wizard.py b/klippy/extras/wizard/wizard.py index ef729cc00b1d..dd8967849e9e 100644 --- a/klippy/extras/wizard/wizard.py +++ b/klippy/extras/wizard/wizard.py @@ -29,7 +29,6 @@ def __init__(self, config): self.type = config.get('type', 'any') self.steps = config.getlists('steps', []) self.current_step = self.steps[0] - self.next_step = self.steps[1] if len(self.steps) > 2 else self.steps[0] # load objects self.printer = printer = config.get_printer() self.gcode = printer.lookup_object('gcode') @@ -54,8 +53,7 @@ def get_status(self, eventtime=None): 'variables': self.variables, 'name': self.name, 'steps': self.steps, - 'type': self.type, - 'next_step': self.next_step} + 'type': self.type} cmd_SET_WIZARD_VARIABLE_help = "Set the value of a wizard variable to wizard" @@ -89,9 +87,6 @@ def cmd_SET_WIZARD_STEP(self, gcmd): if step not in self.steps: raise gcmd.error("2053: Unknown step: '%s'" % step) self.current_step = step - if self.current_step != self.steps[-1]: - current_step_idx = self.steps.index(self.current_step) - self.next_step = self.steps[current_step_idx + 1] cmd_RESET_WIZARD_help = "Reset state the wizard" @@ -99,7 +94,6 @@ def cmd_RESET_WIZARD(self, gcmd): self.error = '' self.enabled = False self.current_step = self.steps[0] - self.next_step = self.steps[1] if len(self.steps) > 2 else self.steps[0] self.variables = dict(self._variables_bk) diff --git a/klippy/extras/wizard/wizard_step.py b/klippy/extras/wizard/wizard_step.py index 78d93f181e3b..ff9c3cb3e1a1 100644 --- a/klippy/extras/wizard/wizard_step.py +++ b/klippy/extras/wizard/wizard_step.py @@ -67,16 +67,27 @@ def cmd(self, gcmd, gcode): self.in_script = True try: if gcode == 'action_gcode': + kwparams['wizard']['next_step'] = self.get_next_step(kwparams) self.template_action.run_gcode_from_command(kwparams) elif gcode == 'cancel_gcode': self.template_cancel.run_gcode_from_command(kwparams) finally: self.in_script = False + def get_next_step(self, kwparams): + steps = kwparams['wizard']['steps'] + if self.name == steps[-1]: + next_step = steps[0] + else: + current_step_idx = steps.index(self.name) + next_step = steps[current_step_idx + 1] + return next_step + def get_status(self, eventtime): return { 'loading': self.loading, 'placeholder': self.placeholder} + def load_config_prefix(config): return WizardStep(config) From b59aa507afda2fa144e55455a2c7b23dbce4df72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Fri, 16 Feb 2024 09:39:40 +0300 Subject: [PATCH 2/6] STEAPP-921: rename the placeholders --- stereotech_config/wizards/5d_calibration_auto.cfg | 4 ++-- stereotech_config/wizards/adjust_basement_auto.cfg | 4 ++-- stereotech_config/wizards/adjust_basement_manual.cfg | 2 +- stereotech_config/wizards/bed_level_auto.cfg | 6 +++--- stereotech_config/wizards/bed_level_manual.cfg | 2 +- stereotech_config/wizards/change_material_fiber.cfg | 8 ++++---- stereotech_config/wizards/change_material_filament.cfg | 8 ++++---- stereotech_config/wizards/common.cfg | 2 +- stereotech_config/wizards/nozzle_offset_5d.cfg | 2 +- stereotech_config/wizards/nozzle_offset_fiber.cfg | 2 +- stereotech_config/wizards/nozzle_offset_hybrid.cfg | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/stereotech_config/wizards/5d_calibration_auto.cfg b/stereotech_config/wizards/5d_calibration_auto.cfg index 461b3a791f23..9d6b2dc7d1e3 100644 --- a/stereotech_config/wizards/5d_calibration_auto.cfg +++ b/stereotech_config/wizards/5d_calibration_auto.cfg @@ -39,7 +39,7 @@ cancel_gcode: [wizard_step CALIBRATE_5D_AUTO3] image: wizards/5d_calibration_auto/auto_five_axis_level_04.jpg description: Wizards.Common.ConnectAndCheck -placeholder: wizard-step-probe +placeholder: probe action_gcode: {% set cmd = 'CALIBRATE_MODULE_FIVE_D' %} CHANGE_STEP_AND_WAIT_RUN_CMD WIZARD={wizard.name} STEP={wizard.next_step} CMD={cmd} @@ -50,7 +50,7 @@ cancel_gcode: image: wizards/5d_calibration_auto/auto_five_axis_level_05.jpg description: Wizards.5DCalibrationAuto.Wait countdown: 420 -placeholder: waitProgress true +placeholder: сommand action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} cancel_gcode: diff --git a/stereotech_config/wizards/adjust_basement_auto.cfg b/stereotech_config/wizards/adjust_basement_auto.cfg index 5ef80e7fe2b5..b23e45495602 100644 --- a/stereotech_config/wizards/adjust_basement_auto.cfg +++ b/stereotech_config/wizards/adjust_basement_auto.cfg @@ -35,7 +35,7 @@ cancel_gcode: [wizard_step ADJUST_BASEMENT_AUTO3] image: wizards/5d_calibration_auto/auto_five_axis_level_04.jpg description: Wizards.Common.ConnectAndCheck -placeholder: wizard-step-probe +placeholder: probe action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} cancel_gcode: @@ -78,7 +78,7 @@ cancel_gcode: [wizard_step ADJUST_BASEMENT_AUTO6] image: wizards/5d_calibration_auto/auto_five_axis_level_03.jpg description: Wizards.Common.DisableSensor -placeholder: waitProgress true +placeholder: сommand action_gcode: {% set wcs = wizard.variables.wcs %} ADJUST_BASEMENT_WCS WCS={wcs} diff --git a/stereotech_config/wizards/adjust_basement_manual.cfg b/stereotech_config/wizards/adjust_basement_manual.cfg index 19ea34346c01..98b31f2ec0c9 100644 --- a/stereotech_config/wizards/adjust_basement_manual.cfg +++ b/stereotech_config/wizards/adjust_basement_manual.cfg @@ -45,7 +45,7 @@ cancel_gcode: image: wizards/zero_point_setup/zero_point_setup.jpg description: Wizards.Common.SelectMode items: 5D_spiral, 5D_spiral_full -placeholder: wizard-step-probe +placeholder: probe action_gcode: {% set wcs = wizard.variables.wcs|int %} MOVE_WCS_ZERO WCS={wcs} diff --git a/stereotech_config/wizards/bed_level_auto.cfg b/stereotech_config/wizards/bed_level_auto.cfg index ccc37311c33c..79332bfdfdd6 100644 --- a/stereotech_config/wizards/bed_level_auto.cfg +++ b/stereotech_config/wizards/bed_level_auto.cfg @@ -6,7 +6,7 @@ steps: BED_LEVEL_MANUAL0, CLEAR_NOZZLE0, CLEAR_NOZZLE1, BED_LEVEL_MANUAL1, BED_L [wizard_step_button BED_LEVEL_AUTO3] image: wizards/bed_level_manual/bed_leveling04.jpg description: Wizards.Common.WaitBedStop -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: ABORT ACCEPT_Z_ENDSTOP PROBE=1 @@ -28,7 +28,7 @@ cancel_gcode: [wizard_step BED_LEVEL_AUTO5] image: wizards/5d_calibration_auto/auto_five_axis_level_04.jpg description: Wizards.Common.ConnectAndCheck -placeholder: wizard-step-probe +placeholder: probe action_gcode: {% set cmd = 'CALIBRATE_MODULE_THREE_D' %} CHANGE_STEP_AND_WAIT_RUN_CMD WIZARD={wizard.name} STEP={wizard.next_step} CMD={cmd} @@ -39,7 +39,7 @@ cancel_gcode: image: wizards/bed_level_auto/auto_bed_leveling_02.jpg description: Wizards.BedLevelAuto.Wait countdown: 420 -placeholder: waitProgress true +placeholder: сommand action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} cancel_gcode: diff --git a/stereotech_config/wizards/bed_level_manual.cfg b/stereotech_config/wizards/bed_level_manual.cfg index a7731d991438..1438ccd6a3b0 100644 --- a/stereotech_config/wizards/bed_level_manual.cfg +++ b/stereotech_config/wizards/bed_level_manual.cfg @@ -45,7 +45,7 @@ cancel_gcode: [wizard_step_button BED_LEVEL_MANUAL3] image: wizards/bed_level_manual/bed_leveling04.jpg description: Wizards.Common.WaitBedStop -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: ABORT SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} diff --git a/stereotech_config/wizards/change_material_fiber.cfg b/stereotech_config/wizards/change_material_fiber.cfg index f5e0affad975..dc3a7e0b5d20 100644 --- a/stereotech_config/wizards/change_material_fiber.cfg +++ b/stereotech_config/wizards/change_material_fiber.cfg @@ -56,7 +56,7 @@ cancel_gcode: [wizard_step_button CHANGE_MATERIAL_FIBER3] image: wizards/change_material/change_material03.jpg description: Wizards.ChangeMaterialFiber.WaitHeater -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: {% set selected_e = wizard.variables.selected_e %} {% set cooldown_temp = wizard.variables.cooldown_temp %} @@ -80,7 +80,7 @@ button_cut_gcode: [wizard_step CHANGE_MATERIAL_FIBER4] image: wizards/change_material/change_material.jpg description: Wizards.ChangeMaterialFiber.InstallMaterialSpool -placeholder: wizard-step-preheat # COOL DOWN +placeholder: preheat # COOL DOWN action_gcode: {% set temperature = wizard.variables.temperature %} {% set selected_e = wizard.variables.selected_e %} @@ -91,7 +91,7 @@ cancel_gcode: [wizard_step_button CHANGE_MATERIAL_FIBER5] image: wizards/change_material/change_material04.jpg description: Wizards.ChangeMaterialFiber.LoadPushPull -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} cancel_gcode: @@ -121,7 +121,7 @@ cancel_gcode: [wizard_step_button CHANGE_MATERIAL_FIBER7] image: wizards/change_material/change_material04.jpg description: Wizards.ChangeMaterialFiber.FiberFromNozzle -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} cancel_gcode: diff --git a/stereotech_config/wizards/change_material_filament.cfg b/stereotech_config/wizards/change_material_filament.cfg index 9603b6d46aba..565d72a910ca 100644 --- a/stereotech_config/wizards/change_material_filament.cfg +++ b/stereotech_config/wizards/change_material_filament.cfg @@ -84,7 +84,7 @@ cancel_gcode: [wizard_step_button CHANGE_MATERIAL_FILAMENT5] image: wizards/change_material/change_material03.jpg description: Wizards.ChangeMaterialFilament.UnloadMaterial -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: {% set action = wizard.variables.action %} {% if action == 'remove' %} @@ -133,7 +133,7 @@ cancel_gcode: [wizard_step CHANGE_MATERIAL_FILAMENT8] image: wizards/change_material/change_material.jpg description: Wizards.ChangeMaterialFilament.LoadNewSpool -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: {% set selected_e = wizard.variables.selected_e %} {% set temperature = printer[selected_e].target|float %} @@ -144,7 +144,7 @@ cancel_gcode: [wizard_step_button CHANGE_MATERIAL_FILAMENT9] image: wizards/change_material/change_material04.jpg description: Wizards.ChangeMaterialFilament.PressLoad -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP=CHANGE_MATERIAL_FILAMENT11 cancel_gcode: @@ -160,7 +160,7 @@ button_insert_gcode: [wizard_step_button CHANGE_MATERIAL_FILAMENT10] image: wizards/change_material/change_material04.jpg description: Wizards.ChangeMaterialFilament.PressLoadFiber -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} cancel_gcode: diff --git a/stereotech_config/wizards/common.cfg b/stereotech_config/wizards/common.cfg index 7fe8c8570057..d6e788da0354 100644 --- a/stereotech_config/wizards/common.cfg +++ b/stereotech_config/wizards/common.cfg @@ -80,7 +80,7 @@ gcode: [wizard_step CLEAR_NOZZLE0] description: Wizards.ClearNozzle.WaitHeating -placeholder: wizard-step-preheat +placeholder: preheat action_gcode: RETRACT_MATERIAL SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} diff --git a/stereotech_config/wizards/nozzle_offset_5d.cfg b/stereotech_config/wizards/nozzle_offset_5d.cfg index 25b13d39168b..14fe3460f057 100644 --- a/stereotech_config/wizards/nozzle_offset_5d.cfg +++ b/stereotech_config/wizards/nozzle_offset_5d.cfg @@ -38,7 +38,7 @@ cancel_gcode: [wizard_step NOZZLE_OFFSET_5D3] image: wizards/5d_calibration_auto/auto_five_axis_level_04.jpg description: Wizards.Common.ConnectAndCheck -placeholder: wizard-step-probe +placeholder: probe action_gcode: ADJUST_NOZZLE_OFFSET_Z SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} diff --git a/stereotech_config/wizards/nozzle_offset_fiber.cfg b/stereotech_config/wizards/nozzle_offset_fiber.cfg index 3fe0219f2025..085b527837e3 100644 --- a/stereotech_config/wizards/nozzle_offset_fiber.cfg +++ b/stereotech_config/wizards/nozzle_offset_fiber.cfg @@ -57,7 +57,7 @@ cancel_gcode: image: wizards/nozzle_offset/wait_for_print.jpg description: Wizards.NozzleOffset.WaitForPrint countdown: 1140 -placeholder: wizard-step-preheat +placeholder: preheat axes: z steps: 0.05, 0.1, 1 default_step: 0.1 diff --git a/stereotech_config/wizards/nozzle_offset_hybrid.cfg b/stereotech_config/wizards/nozzle_offset_hybrid.cfg index 37e8551b0f3a..7678b7bc6fb4 100644 --- a/stereotech_config/wizards/nozzle_offset_hybrid.cfg +++ b/stereotech_config/wizards/nozzle_offset_hybrid.cfg @@ -65,7 +65,7 @@ cancel_gcode: image: wizards/nozzle_offset/wait_for_print.jpg description: Wizards.NozzleOffset.WaitForPrint countdown: 540 -placeholder: wizard-step-preheat +placeholder: preheat axes: z steps: 0.05, 0.1, 1 default_step: 0.1 From 7ccfb7d5e72784299627db4aa9ce698522ea224e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Fri, 16 Feb 2024 17:21:38 +0300 Subject: [PATCH 3/6] STEAPP-921: fixed bug, not the full name of the step description --- stereotech_config/wizards/bed_level.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stereotech_config/wizards/bed_level.cfg b/stereotech_config/wizards/bed_level.cfg index 520095325c54..735762de9702 100644 --- a/stereotech_config/wizards/bed_level.cfg +++ b/stereotech_config/wizards/bed_level.cfg @@ -4,7 +4,7 @@ type: 3d steps: BED_LEVEL0 [wizard_step_wizards BED_LEVEL0] -description: ChangeMaterialFilament.ManagersChoiceDescription +description: Wizards.ChangeMaterialFilament.ManagersChoiceDescription wizards: BED_LEVEL_AUTO, BED_LEVEL_MANUAL action_gcode: # pass From 905d66eff432d1db91426835dc304f338582117a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Fri, 16 Feb 2024 17:23:13 +0300 Subject: [PATCH 4/6] STEAPP-921: rename slider --- .../wizards/change_material_filament.cfg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stereotech_config/wizards/change_material_filament.cfg b/stereotech_config/wizards/change_material_filament.cfg index 565d72a910ca..c3eccc2cbfe1 100644 --- a/stereotech_config/wizards/change_material_filament.cfg +++ b/stereotech_config/wizards/change_material_filament.cfg @@ -70,10 +70,10 @@ cancel_gcode: [wizard_step_slider CHANGE_MATERIAL_FILAMENT4] image: wizards/change_material/change_material02.jpg description: Wizards.Common.SelectUnloadingTemperature -slider_slider1_min: 150 -slider_slider1_max: 300 -slider_slider1_step: 5 -slider_slider1_default: 240 +slider_set_temp_min: 150 +slider_set_temp_max: 300 +slider_set_temp_step: 5 +slider_set_temp_default: 240 action_gcode: {% set temperature = printer["wizard_step_slider " ~ wizard.wizard_step_name].slider1|float %} {% set selected_e = wizard.variables.selected_e %} @@ -119,10 +119,10 @@ cancel_gcode: [wizard_step_slider CHANGE_MATERIAL_FILAMENT7] image: wizards/change_material/change_material02.jpg description: Wizards.Common.SelectLoadingTemperature -slider_slider1_min: 150 -slider_slider1_max: 300 -slider_slider1_step: 5 -slider_slider1_default: 240 +slider_set_temp_min: 150 +slider_set_temp_max: 300 +slider_set_temp_step: 5 +slider_set_temp_default: 240 action_gcode: {% set temperature = printer["wizard_step_slider " ~ wizard.wizard_step_name].slider1|float %} {% set selected_e = wizard.variables.selected_e %} From cd22682a72c1f21e0fd8a9aac1a3f9529b2b6907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Wed, 21 Feb 2024 15:31:41 +0300 Subject: [PATCH 5/6] STEAPP-921: fixed bad name, renamed name the button --- .../wizards/cmd_debug/nozzles_height_align_5d_cmd.cfg | 2 +- stereotech_config/wizards/nozzles_height_align_5d.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stereotech_config/wizards/cmd_debug/nozzles_height_align_5d_cmd.cfg b/stereotech_config/wizards/cmd_debug/nozzles_height_align_5d_cmd.cfg index c41f59809137..deb8f3e7f8de 100644 --- a/stereotech_config/wizards/cmd_debug/nozzles_height_align_5d_cmd.cfg +++ b/stereotech_config/wizards/cmd_debug/nozzles_height_align_5d_cmd.cfg @@ -1,7 +1,7 @@ # -------------------------------step 0 EXECUTE_WIZARD_STEP WIZARD=ALIGN_NOZZLES STEP=ALIGN_NOZZLES0 -WIZARD_STEP_BUTTON WIZARD=ALIGN_NOZZLES STEP=ALIGN_NOZZLES0 BUTTON=calibarate_module +WIZARD_STEP_BUTTON WIZARD=ALIGN_NOZZLES STEP=ALIGN_NOZZLES0 BUTTON=calibrate_module CANCEL_WIZARD_STEP WIZARD=ALIGN_NOZZLES STEP=ALIGN_NOZZLES0 # -------------------------------step 1 diff --git a/stereotech_config/wizards/nozzles_height_align_5d.cfg b/stereotech_config/wizards/nozzles_height_align_5d.cfg index 395b630ec84a..99a45c11bb8e 100644 --- a/stereotech_config/wizards/nozzles_height_align_5d.cfg +++ b/stereotech_config/wizards/nozzles_height_align_5d.cfg @@ -17,7 +17,7 @@ action_gcode: # 5d SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step} {% endif %} -button_calibarate_module_gcode: +button_calibrate_module_gcode: {% if printer["gcode_button five_axis_module"].state == "RELEASED" %} # 3d {% if printer.probe %} From d21a2c15f4af70cc6d7a3d58973089b0b94b72cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Wed, 21 Feb 2024 15:37:23 +0300 Subject: [PATCH 6/6] STEAPP-921: fixed bad name, renamed name the button --- stereotech_config/wizards/nozzles_height_align_5d.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stereotech_config/wizards/nozzles_height_align_5d.cfg b/stereotech_config/wizards/nozzles_height_align_5d.cfg index 99a45c11bb8e..0d955582034a 100644 --- a/stereotech_config/wizards/nozzles_height_align_5d.cfg +++ b/stereotech_config/wizards/nozzles_height_align_5d.cfg @@ -65,7 +65,7 @@ cancel_gcode: [wizard_step ALIGN_NOZZLES3] image: wizards/nozzle_offset/adjust_nozzle.jpg -description: AlignHeightNozzles5D.TightNozzle +description: Wizards.AlignHeightNozzles5D.TightNozzle action_gcode: G91 G0 Z30 F600 @@ -76,7 +76,7 @@ cancel_gcode: [wizard_step ALIGN_NOZZLES4] image: wizards/nozzle_offset/wait_for_print.jpg -description: AlignHeightNozzles5D.Completed +description: Wizards.AlignHeightNozzles5D.Completed action_gcode: RESET_WIZARD WIZARD={wizard.name} ABORT=0 cancel_gcode: