Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STEAPP-927: added options the loadingtime to the wizard_button #251

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/stereotech/guide_config/wizards.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ A step to port the button component, with which you can respond to button clicks

button_<button_name>_gcode:
write gcode which will be running if send the cmd [WIZARD_STEP_BUTTON]
...
button_<button_name>_loadingtime:
the delay about press button, default 0.0

```

## status
Expand Down
11 changes: 7 additions & 4 deletions klippy/extras/wizard/wizard_step_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ def __init__(self, config):
self.templates = {}
options_name = config.get_prefix_options('button_')
for option in options_name:
template_button = self.gcode_macro.load_template(
config, option)
button_name = '_'.join(option.split('_')[1:-1])
self.templates.update({button_name: template_button})
if option.endswith('gcode'):
template_button = self.gcode_macro.load_template(
config, option)
button_name = '_'.join(option.split('_')[1:-1])
self.templates.update({button_name: template_button})
# get the time delay about press button needed for rendering on the client
_ = config.getfloat('button_' + button_name + '_loadingtime', 0)
# register commands
self.gcode.register_mux_command("WIZARD_STEP_BUTTON", 'STEP',
self.name, self.cmd_WIZARD_STEP_BUTTON,
Expand Down
1 change: 1 addition & 0 deletions stereotech_config/wizards/change_material_fiber.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ cancel_gcode:
image: wizards/change_material/change_material04.jpg
description: Wizards.ChangeMaterialFiber.LoadPushPull
placeholder: wizard-step-preheat
button_insert_loadingtime: 2000
action_gcode:
SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.next_step}
cancel_gcode:
Expand Down
1 change: 1 addition & 0 deletions stereotech_config/wizards/change_material_filament.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ cancel_gcode:
image: wizards/change_material/change_material04.jpg
description: Wizards.ChangeMaterialFilament.PressLoad
placeholder: wizard-step-preheat
button_insert_loadingtime: 2000
action_gcode:
SET_WIZARD_STEP WIZARD={wizard.name} STEP=CHANGE_MATERIAL_FILAMENT11
cancel_gcode:
Expand Down
Loading