diff --git a/HTE530-5-4-22.cfg b/HTE530-5-4-22.cfg index b58270770307..b23921b92c8b 100644 --- a/HTE530-5-4-22.cfg +++ b/HTE530-5-4-22.cfg @@ -42,6 +42,8 @@ path: /home/ste/uploads [include stereotech_config/common/variables.cfg] [include stereotech_config/common/diagnostics.cfg] +[include stereotech_config/wizards/wizards.cfg] + [gcode_macro CONSTANTS] description: Holds printer constants variable_probe_a_horizontal: 159, 246.5, 40 diff --git a/docs/stereotech/error_list_guide.txt b/docs/stereotech/error_list_guide.txt index 9bae5f8f821e..ef1eadc4212d 100644 --- a/docs/stereotech/error_list_guide.txt +++ b/docs/stereotech/error_list_guide.txt @@ -112,6 +112,17 @@ config: 2047: auto_wcs: improperly formatted entry for point %s 2048: The parameter value is out of range, param=%smm max=%smm, min=0.0mm. Check params. 2049: Large difference between two values (x1-x2 or y1-y2), maximum difference=%smm. Check the parameters. + 2050: No module named %s, error: %s + 2051: Unknown wizard variable '%s' + 2052: Unable to parse '%s' as a literal: %s + 2053: Unknown step: '%s' + 2054: Macro %s called recursively + 2055: Failure set value:%s to variable:%s in the slider %s + 2056: The selected item %s not in the items %s + 2057: error setting the value:%s to move the axis, the value is out of range + 2058: error moved the axis:%s, the axis not availability + 2059: Macro %s called recursively + 2060: The button '%s' does not exist перефирия(mcu): 301: Timeout on wait for '%s' response diff --git a/klippy/extras/wizard/__init__.py b/klippy/extras/wizard/__init__.py new file mode 100644 index 000000000000..b843bc586528 --- /dev/null +++ b/klippy/extras/wizard/__init__.py @@ -0,0 +1,10 @@ +import importlib + + +def load_config_prefix(config): + mod_name = 'extras.wizard.' + config.get_name().split()[0] + try: + mod = importlib.import_module(mod_name) + return mod.load_config_prefix(config) + except Exception as e: + raise Exception('2050: No module named %s, error: %s' % (mod_name, e)) diff --git a/klippy/extras/wizard/wizard.py b/klippy/extras/wizard/wizard.py new file mode 100644 index 000000000000..e607b805daa3 --- /dev/null +++ b/klippy/extras/wizard/wizard.py @@ -0,0 +1,100 @@ +import ast +import json + + +class Wizard: + def __init__(self, config): + if len(config.get_name().split()) > 2: + raise config.error( + "Name of section '%s' contains illegal whitespace" + % (config.get_name())) + self.name = config.get_name().split()[1] + self.enabled = False + self.error = '' + self.variables = {} + self._variables_bk = {} + prefix = 'variable_' + for option in config.get_prefix_options(prefix): + try: + literal = ast.literal_eval(config.get(option)) + json.dumps(literal, separators=(',', ':')) + self.variables[option[len(prefix):]] = literal + self._variables_bk[option[len(prefix):]] = literal + except (SyntaxError, TypeError, ValueError) as e: + raise config.error( + "Option '%s' in section '%s' is not a valid literal: %s" % ( + option, config.get_name(), e)) + # get options from config + self.image = config.get('image', 'image_path') + self.type = config.getlists('type', []) + self.steps = config.getlists('steps', []) + self.current_step = self.steps[0] + # load objects + self.printer = printer = config.get_printer() + self.gcode = printer.lookup_object('gcode') + # register commands + self.gcode.register_mux_command("SET_WIZARD_VARIABLE", "WIZARD", + self.name, self.cmd_SET_WIZARD_VARIABLE, + desc=self.cmd_SET_WIZARD_VARIABLE_help) + self.gcode.register_mux_command("SET_WIZARD_ENABLE", "WIZARD", + self.name, self.cmd_SET_WIZARD_ENABLE, + desc=self.cmd_SET_WIZARD_ENABLE_help) + self.gcode.register_mux_command("SET_WIZARD_STEP", "WIZARD", + self.name, self.cmd_SET_WIZARD_STEP, + desc=self.cmd_SET_WIZARD_STEP_help) + self.gcode.register_mux_command("RESET_WIZARD", "WIZARD", + self.name, self.cmd_RESET_WIZARD, + desc=self.cmd_RESET_WIZARD_help) + + def get_status(self, eventtime=None): + return {'current_step': self.current_step, + 'enabled': self.enabled, + 'error': self.error, + 'variables': self.variables, + 'name': self.name, + 'steps': self.steps, + 'type': self.type} + + cmd_SET_WIZARD_VARIABLE_help = "Set the value of a wizard variable to wizard" + + def cmd_SET_WIZARD_VARIABLE(self, gcmd): + variable = gcmd.get('VARIABLE') + value = gcmd.get('VALUE') + if variable not in self.variables: + raise gcmd.error( + "2051: Unknown wizard variable '%s'" % (variable,)) + try: + literal = ast.literal_eval(value) + json.dumps(literal, separators=(',', ':')) + except (SyntaxError, TypeError, ValueError) as e: + raise gcmd.error("2052: Unable to parse '%s' as a literal: %s" % + (value, e)) + v = dict(self.variables) + v[variable] = literal + self.variables = v + + cmd_SET_WIZARD_ENABLE_help = "Set the enable to WIZARD" + + def cmd_SET_WIZARD_ENABLE(self, gcmd): + self.enabled = True if gcmd.get_int('ENABLE', self.enabled) else False + self.error = gcmd.get('ERROR', self.error) + + cmd_SET_WIZARD_STEP_help = "Set the step to WIZARD" + + def cmd_SET_WIZARD_STEP(self, gcmd): + step = gcmd.get('STEP') + if step not in self.steps: + raise gcmd.error("2053: Unknown step: '%s'" % step) + self.current_step = step + + cmd_RESET_WIZARD_help = "Reset state the wizard" + + def cmd_RESET_WIZARD(self, gcmd): + self.error = '' + self.enabled = False + self.current_step = self.steps[0] + self.variables = dict(self._variables_bk) + + +def load_config_prefix(config): + return Wizard(config) diff --git a/klippy/extras/wizard/wizard_step.py b/klippy/extras/wizard/wizard_step.py new file mode 100644 index 000000000000..0d37fa8d6b73 --- /dev/null +++ b/klippy/extras/wizard/wizard_step.py @@ -0,0 +1,67 @@ +class WizardStep: + def __init__(self, config): + if len(config.get_name().split()) > 2: + raise config.error( + "Name of section '%s' contains illegal whitespace" + % (config.get_name())) + section_name = config.get_name().split() + self.name = section_name[1].upper() + self.in_script = False + # load objects + self.printer = printer = config.get_printer() + self.gcode_macro = printer.load_object(config, 'gcode_macro') + self.gcode = printer.lookup_object('gcode') + # get options from config + self.cmd_desc = config.get("description", "G-Code wizard") + self.image = config.get('image', 'image_path') + self.landscape = config.getboolean('landscape', False) + self.description = config.get('description', '') + self.warning = config.get('warning', '') + self.info = config.get('info', '') + self.countdown = config.getint('countdown', 0) + # create template + self.template_action = self.gcode_macro.load_template( + config, 'action_gcode') + self.template_cancel = self.gcode_macro.load_template( + config, 'cancel_gcode') + # register gcode commands + self.gcode.register_mux_command("EXECUTE_WIZARD_STEP", 'STEP', + self.name, self.cmd_EXECUTE_WIZARD_STEP, + desc=self.cmd_EXECUTE_WIZARD_STEP_help) + self.gcode.register_mux_command("CANCEL_WIZARD_STEP", 'STEP', + self.name, self.cmd_CANCEL_WIZARD_STEP, + desc=self.cmd_CANCEL_WIZARD_STEP_help) + + cmd_EXECUTE_WIZARD_STEP_help = "Run gcode in the 'action_gcode' option" + + def cmd_EXECUTE_WIZARD_STEP(self, gcmd): + self.cmd(gcmd=gcmd, gcode='action_gcode') + + cmd_CANCEL_WIZARD_STEP_help = "Run gcode in the 'cancel_gcode' option" + + def cmd_CANCEL_WIZARD_STEP(self, gcmd): + self.cmd(gcmd=gcmd, gcode='cancel_gcode') + + def cmd(self, gcmd, gcode): + if self.in_script: + raise gcmd.error( + "2054: Macro %s called recursively" % (self.name,)) + wizard_name = gcmd.get('WIZARD').upper() + wizard_obj = self.printer.lookup_object('wizard %s' % wizard_name) + kwparams = self.template_action.create_template_context() + kwparams['wizard'] = wizard_obj.get_status() + kwparams['wizard'].update({'wizard_step_name': self.name}) + kwparams['params'] = gcmd.get_command_parameters() + kwparams['rawparams'] = gcmd.get_raw_command_parameters() + self.in_script = True + try: + if gcode == 'action_gcode': + 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 load_config_prefix(config): + return WizardStep(config) diff --git a/klippy/extras/wizard/wizard_step_button.py b/klippy/extras/wizard/wizard_step_button.py new file mode 100644 index 000000000000..6c76416fe19c --- /dev/null +++ b/klippy/extras/wizard/wizard_step_button.py @@ -0,0 +1,46 @@ +from wizard_step import WizardStep + + +class WizardStepButton(WizardStep): + def __init__(self, config): + WizardStep.__init__(self, config) + # create template for buttons + 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}) + # register commands + self.gcode.register_mux_command("WIZARD_STEP_BUTTON", 'STEP', + self.name, self.cmd_WIZARD_STEP_BUTTON, + desc=self.cmd_WIZARD_STEP_BUTTON_help) + + cmd_WIZARD_STEP_BUTTON_help = "Run gcode in the 'button_%s_gcode' section" + + def cmd_WIZARD_STEP_BUTTON(self, gcmd): + if self.in_script: + raise gcmd.error( + "2054: Macro %s called recursively" % (self.name,)) + wizard_name = gcmd.get('WIZARD').upper() + wizard_obj = self.printer.lookup_object('wizard %s' % wizard_name) + button = gcmd.get('BUTTON', '').lower() + template_button = self.templates.get(button, None) + if template_button is None: + raise gcmd.error( + "2060: The button '%s' does not exist" % (button,)) + kwparams = template_button.create_template_context() + kwparams['wizard'] = wizard_obj.get_status() + kwparams['wizard'].update({'wizard_step_name': self.name}) + kwparams['params'] = gcmd.get_command_parameters() + kwparams['rawparams'] = gcmd.get_raw_command_parameters() + self.in_script = True + try: + template_button.run_gcode_from_command(kwparams) + finally: + self.in_script = False + + +def load_config_prefix(config): + return WizardStepButton(config) diff --git a/klippy/extras/wizard/wizard_step_jog.py b/klippy/extras/wizard/wizard_step_jog.py new file mode 100644 index 000000000000..89498fcf3055 --- /dev/null +++ b/klippy/extras/wizard/wizard_step_jog.py @@ -0,0 +1,64 @@ +from wizard_step import WizardStep + + +class WizardStepJog(WizardStep): + def __init__(self, config): + WizardStep.__init__(self, config) + # get options + self.axes = config.getlists('axes', ['x', 'y', 'z']) + self.steps = config.getfloatlist('steps') + self.default_step = config.getfloat('default_step', 10) + # create template + self.template_jog = self.gcode_macro.load_template(config, 'jog_gcode') + # register gcode commands + self.gcode.register_mux_command("WIZARD_STEP_JOG", 'STEP', + self.name, self.cmd_WIZARD_STEP_JOG, + desc=self.cmd_WIZARD_STEP_JOG_help) + self.gcode.register_mux_command("WIZARD_STEP_SET_STEP", 'STEP', + self.name, self.cmd_WIZARD_STEP_SET_STEP, + desc=self.cmd_WIZARD_STEP_SET_STEP_help) + + cmd_WIZARD_STEP_SET_STEP_help = "Set step for moving the axis" + + def cmd_WIZARD_STEP_SET_STEP(self, gcmd): + value = gcmd.get_float('VALUE') + if value not in self.steps: + raise gcmd.error( + "2057: error setting the value:%s to move the axis, the value is out of range" % (value,)) + self.default_step = value + + cmd_WIZARD_STEP_JOG_help = "Perform axis movement" + + def cmd_WIZARD_STEP_JOG(self, gcmd): + axis = gcmd.get('AXIS').lower() + # get direction move, 1-positive, 0-negative moving + direction = gcmd.get('DIRECTION', 1) + if axis not in self.axes: + raise gcmd.error( + "2058: error moved the axis:%s, the axis not availability" % (axis,)) + if self.in_script: + raise gcmd.error( + "2059: Macro %s called recursively" % (self.name,)) + # update status to the wizard + wizard_name = gcmd.get('WIZARD').upper() + wizard_obj = self.printer.lookup_object('wizard %s' % wizard_name) + kwparams = self.template_action.create_template_context() + kwparams['wizard'] = wizard_obj.get_status() + kwparams['wizard'].update({'wizard_step_name': self.name}) + kwparams['params'] = gcmd.get_command_parameters() + kwparams['rawparams'] = gcmd.get_raw_command_parameters() + kwparams['axis'] = axis + kwparams['step'] = self.default_step + kwparams['direction'] = direction + self.in_script = True + try: + self.template_jog.run_gcode_from_command(kwparams) + finally: + self.in_script = False + + def get_status(self, eventtime): + return {'step': self.default_step} + + +def load_config_prefix(config): + return WizardStepJog(config) diff --git a/klippy/extras/wizard/wizard_step_selector.py b/klippy/extras/wizard/wizard_step_selector.py new file mode 100644 index 000000000000..f5e314f8beca --- /dev/null +++ b/klippy/extras/wizard/wizard_step_selector.py @@ -0,0 +1,48 @@ +from wizard_step import WizardStep + + +class WizardStepSelector(WizardStep): + def __init__(self, config): + WizardStep.__init__(self, config) + self.selected = '' + # get options + self.items = config.getlists('items', []) + # create template + self.template = self.gcode_macro.load_template(config, 'select_gcode') + # register commands + self.gcode.register_mux_command("WIZARD_STEP_SELECT", 'STEP', + self.name, self.cmd_WIZARD_STEP_SELECT, + desc=self.cmd_WIZARD_STEP_SELECT_help) + + cmd_WIZARD_STEP_SELECT_help = "Run gcode in the 'select_gcode' section" + + def cmd_WIZARD_STEP_SELECT(self, gcmd): + if self.in_script: + raise gcmd.error( + "2054: Macro %s called recursively" % (self.name,)) + selected = gcmd.get('ITEM') + if selected not in self.items: + raise gcmd.error( + "2056: The selected item %s not in the items %s" % (selected, self.items)) + self.selected = selected + wizard_name = gcmd.get('WIZARD').upper() + wizard_obj = self.printer.lookup_object('wizard %s' % wizard_name) + kwparams = self.template_action.create_template_context() + kwparams['wizard'] = wizard_obj.get_status() + kwparams['wizard'].update({'wizard_step_name': self.name}) + kwparams['params'] = gcmd.get_command_parameters() + kwparams['rawparams'] = gcmd.get_raw_command_parameters() + kwparams['selected'] = self.selected + self.in_script = True + try: + self.template.run_gcode_from_command(kwparams) + finally: + self.in_script = False + + def get_status(self, eventtime): + return {'selected': self.selected + } + + +def load_config_prefix(config): + return WizardStepSelector(config) diff --git a/klippy/extras/wizard/wizard_step_slider.py b/klippy/extras/wizard/wizard_step_slider.py new file mode 100644 index 000000000000..d21e365246c1 --- /dev/null +++ b/klippy/extras/wizard/wizard_step_slider.py @@ -0,0 +1,44 @@ +from wizard_step import WizardStep + + +OPTIONS = { + 'min': 0, + 'max': 100, + 'step': 1, + 'default': 20, +} + +class WizardStepSlider(WizardStep): + def __init__(self, config): + WizardStep.__init__(self, config) + # get slider options from config + self.slider_data = {} + options = config.get_prefix_options('slider_') + sliders = {'_'.join(option.split('_')[1:-1]) for option in options} + for slider in sliders: + self.slider_data.update({slider: {}}) + for key, value in OPTIONS.items(): + option_name = 'slider_%s_%s' % (slider, key) + config_value = config.getfloat(option_name, value) + self.slider_data[slider].update({option_name: config_value}) + if 'default' in option_name: + self.slider_data[slider].update({'current_value': config_value}) + self.gcode.register_mux_command("WIZARD_STEP_SLIDER", 'STEP', + self.name, self.cmd_WIZARD_STEP_SLIDER, + desc=self.cmd_WIZARD_STEP_SLIDER_help) + + cmd_WIZARD_STEP_SLIDER_help = "update value to the slider data" + + def cmd_WIZARD_STEP_SLIDER(self, gcmd): + slider = gcmd.get('SLIDER') + value = gcmd.get_float('VALUE') + if slider not in self.slider_data: + raise gcmd.error("2055: Failure set value:%s to slider:%s" % (value, slider)) + self.slider_data[slider].update({'current_value': value}) + + def get_status(self, eventtime): + return {slider: value['current_value'] for slider, value in self.slider_data.items()} + + +def load_config_prefix(config): + return WizardStepSlider(config) diff --git a/klippy/extras/wizard/wizard_step_wizards.py b/klippy/extras/wizard/wizard_step_wizards.py new file mode 100644 index 000000000000..bdb53d7a975a --- /dev/null +++ b/klippy/extras/wizard/wizard_step_wizards.py @@ -0,0 +1,11 @@ +from wizard_step import WizardStep + + +class WizardStepWizards(WizardStep): + def __init__(self, config): + WizardStep.__init__(self, config) + self.wizards = config.getlists('wizards', []) + + +def load_config_prefix(config): + return WizardStepWizards(config) diff --git a/klippy/klippy.py b/klippy/klippy.py index 15025c5a0ca4..00d5849405f8 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -110,6 +110,8 @@ def load_object(self, config, section, default=configfile.sentinel): return self.objects[section] module_parts = section.split() module_name = module_parts[0] + if 'wizard' in section: + module_name = 'wizard' py_name = os.path.join(os.path.dirname(__file__), 'extras', module_name + '.py') py_dirname = os.path.join(os.path.dirname(__file__), diff --git a/stereotech_config/wizards/change_material.cfg b/stereotech_config/wizards/change_material.cfg new file mode 100644 index 000000000000..dba82f5e1211 --- /dev/null +++ b/stereotech_config/wizards/change_material.cfg @@ -0,0 +1,231 @@ +[wizard CHANGE_MATERIAL] +image: wizards/change_material/change_material.jpg +type: any +steps: CHANGE_MATERIAL_0, STEP_2 +variable_needed_action: '' +variable_manufacturer_select: '' +variable_seria_select: '' + + + +# ---------------------------------------------------------------------------step0 + +[wizard_step CHANGE_MATERIAL_0] +image: wizards/change_material/change_material.jpg +landscape: false +description: This wizard will help you to change insert or remove the material +warning: none +countdown: 0 +info: none +action_gcode: + {action_respond_info('-------------------start CHANGE_MATERIAL_0')} + SET_WIZARD_ENABLE WIZARD=CHANGE_MATERIAL ENABLE=1 # ERROR=error_message +cancel_gcode: + {action_respond_info('------------------CANCEL STEP_0')} + RESET_WIZARD WIZARD={wizard} + # HOME_POSITION ABORT=1 + +[wizard_step_button CHANGE_MATERIAL_BUTTON_0] +image: none +landscape: false +description: START +warning: none +countdown: none +info: none +button_STEP_BUTTON_1_gcode: + {action_respond_info('-------------------CHANGE_MATERIAL_BUTTON_0')} + {% if printer.extruders|int > 1 %} + SET_WIZARD_STEP WIZARD=CHANGE_MATERIAL STEP=CHANGE_MATERIAL_1 + {% else %} + SET_WIZARD_STEP WIZARD=CHANGE_MATERIAL STEP=CHANGE_MATERIAL_2 + ACTIVATE_EXTRUDER EXTRUDER=extruder + {% endif %} +action_gcode: + # pass +cancel_gcode: + # pass + +# ---------------------------------------------------------------------------step1 + +[wizard_step CHANGE_MATERIAL_1] +image: wizards/change_material/change_material01.jpg +landscape: false +description: Select the extruder where you want change the material +warning: none +countdown: 1 +info: none +action_gcode: + # pass +cancel_gcode: + {action_respond_info('------------------CANCEL STEP_0')} + RESET_WIZARD WIZARD={wizard} + # HOME_POSITION ABORT=1 + +[wizard_step_selector CHANGE_MATERIAL_SELECTOR_1] +image: none +landscape: false +description: none +warning: none +countdown: none +info: none +items: extruder, extruder1 +#select_gcode: +action_gcode: + {% set selected = printer['wizard_step_selector CHANGE_MATERIAL_SELECTOR_1'].selected %} + ACTIVATE_EXTRUDER EXTRUDER={selected} + SET_WIZARD_STEP WIZARD={wizard.name} STEP={} +cancel_gcode: + # pass + +[wizard_step_button CHANGE_MATERIAL_BUTTON_1] +image: none +landscape: false +description: NEXT +warning: none +countdown: none +info: none +button_STEP_BUTTON_1_gcode: + {action_respond_info('-------------------CHANGE_MATERIAL_BUTTON_1')} + SET_WIZARD_STEP WIZARD=CHANGE_MATERIAL STEP=CHANGE_MATERIAL_2 +action_gcode: + # pass +cancel_gcode: + # pass + +# ---------------------------------------------------------------------------step2 + +[wizard_step CHANGE_MATERIAL_2] +image: wizards/change_material/change_material02.jpg +landscape: false +description: Select the needed action +warning: none +countdown: 2 +info: none +action_gcode: + # pass +cancel_gcode: + {action_respond_info('------------------CANCEL STEP_0')} + RESET_WIZARD WIZARD={wizard} + # HOME_POSITION ABORT=1 + +[wizard_step_selector CHANGE_MATERIAL_SELECTOR_2] +image: none +landscape: false +description: none +warning: none +countdown: none +info: none +items: Insert, Change, Remove +select_gcode: + {action_respond_info('-------------------select_gcode CHANGE_MATERIAL_SELECTOR_2 selected=%s, wizard=%s' % (selected, wizard))} + SET_WIZARD_VARIABLE WIZARD={wizard.name} VARIABLE=needed_action VALUE={selected} +action_gcode: + # pass +cancel_gcode: + # pass + +[wizard_step_button CHANGE_MATERIAL_BUTTON_2] +image: none +landscape: false +description: NEXT +warning: none +countdown: none +info: none +button_STEP_BUTTON_1_gcode: + {action_respond_info('-------------------CHANGE_MATERIAL_BUTTON_2')} + {% if wizard.variables['needed_action'] == 'Insert' %} + SET_WIZARD_STEP WIZARD={wizard} STEP=CHANGE_MATERIAL_4 # ?????????????????????????? + {% else %} + SET_WIZARD_STEP WIZARD={wizard} STEP=CHANGE_MATERIAL_3 + {% endif %} +action_gcode: + # pass +cancel_gcode: + # pass + +# ---------------------------------------------------------------------------step3 + +[wizard_step CHANGE_MATERIAL_3] +# change or reemove material +image: wizards/change_material/change_material02.jpg +landscape: false +description: Select Current Material +warning: none +countdown: 2 +info: none +action_gcode: + # pass +cancel_gcode: + {action_respond_info('------------------CANCEL CHANGE_MATERIAL_3')} + RESET_WIZARD WIZARD={wizard} + # HOME_POSITION ABORT=1 + +[wizard_step_selector CHANGE_MATERIAL_SELECTOR_3_0] +image: none +landscape: false +description: Manufacturer select +warning: none +countdown: none +info: none +items: Stereotech, Another +select_gcode: + {action_respond_info('-------------------select_gcode CHANGE_MATERIAL_SELECTOR_3_0 selected=%s, wizard=%s' % (selected, wizard))} + SET_WIZARD_VARIABLE WIZARD={wizard} VARIABLE=manufacturer_select VALUE={selected} +action_gcode: + # pass +cancel_gcode: + # pass + +[wizard_step_selector CHANGE_MATERIAL_SELECTOR_3_1] +image: none +landscape: false +description: Seria select +warning: none +countdown: none +info: none +items: Proto, Enduse, Fiberpart, Sealant +select_gcode: + {action_respond_info('-------------------select_gcode CHANGE_MATERIAL_SELECTOR_2 selected=%s, wizard=%s' % (selected, wizard))} + SET_WIZARD_VARIABLE WIZARD={wizard} VARIABLE=seria_select VALUE={selected} + WIZARD_STEP_SELECT WIZARD={wizard} STEP=CHANGE_MATERIAL_SELECTOR_3_2 ITEM= +action_gcode: + # pass +cancel_gcode: + # pass + +Name select +ABS G4 +# step 4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +[wizard_step_selector CHANGE_MATERIAL_SELECTOR_3_2] +image: none +landscape: false +description: Name selected +warning: none +countdown: none +info: none +items: PLA, PVA, Remove +select_gcode: + {action_respond_info('-------------------select_gcode CHANGE_MATERIAL_SELECTOR_2 selected=%s, wizard=%s' % (selected, wizard))} + SET_WIZARD_VARIABLE WIZARD={wizard} VARIABLE=data1 VALUE={selected} +action_gcode: + # pass +cancel_gcode: + # pass + + +[wizard_step_selector MY] +image: none +landscape: false +description: none +warning: none +countdown: none +info: none +items: PLA, PVA, Remove +select_gcode: + {action_respond_info('-------------------select_gcode CHANGE_MATERIAL_SELECTOR_2 selected=%s, wizard=%s' % (selected, wizard))} + SET_WIZARD_VARIABLE WIZARD={wizard} VARIABLE=data1 VALUE={selected} +action_gcode: + # pass +cancel_gcode: + # pass \ No newline at end of file diff --git a/stereotech_config/wizards/wizards.cfg b/stereotech_config/wizards/wizards.cfg new file mode 100644 index 000000000000..50f03b071f3f --- /dev/null +++ b/stereotech_config/wizards/wizards.cfg @@ -0,0 +1,174 @@ +# wizard +# SET_WIZARD_ENABLE WIZARD=CALIBRATE ENABLE=1 ERROR=error_message +# SET_WIZARD_STEP WIZARD=CALIBRATE STEP=step1 +# SET_WIZARD_VARIABLE WIZARD=CALIBRATE VARIABLE=a VALUE=17 +# RESET_WIZARD WIZARD=CALIBRATE + +# wizard_step +# CANCEL_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_0 +# EXECUTE_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_0 + +# wizard_step_button +# CANCEL_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_BUTTON_1 +# EXECUTE_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_BUTTON_1 +# WIZARD_STEP_BUTTON WIZARD=CALIBRATE STEP=STEP_BUTTON_1 BUTTON=button_button_1_gcode +# WIZARD_STEP_BUTTON WIZARD=CALIBRATE STEP=STEP_BUTTON_1 BUTTON=button_button2_gcode + +# wizard_step_wizards +# CANCEL_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_WIZARDS_1 +# EXECUTE_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_WIZARDS_1 + +# wizard_step_selector +# CANCEL_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_SELECTOR_1 +# EXECUTE_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_SELECTOR_1 +# WIZARD_STEP_SELECT WIZARD=CALIBRATE STEP=STEP_SELECTOR_1 ITEM=item3 + +# wizard_step_slider +# CANCEL_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_SLIDER_1 +# EXECUTE_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_SLIDER_1 +# WIZARD_STEP_SLIDER WIZARD=CALIBRATE STEP=STEP_SLIDER_1 SLIDER=slider1 VALUE=12 +# WIZARD_STEP_SLIDER WIZARD=CALIBRATE STEP=STEP_SLIDER_1 SLIDER=slider_2 VALUE=40 + +# wizard_step_jog +# CANCEL_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_JOG_1 +# EXECUTE_WIZARD_STEP WIZARD=CALIBRATE STEP=STEP_JOG_1 +# WIZARD_STEP_JOG WIZARD=CALIBRATE STEP=STEP_JOG_1 AXIS=z DIRECTION=0 +# WIZARD_STEP_SET_STEP WIZARD=CALIBRATE STEP=STEP_JOG_1 VALUE=20 + +[wizard CALIBRATE] +image: path/to/image/wizard/CALIBRATE +type: 3d, 5d, any +steps: STEP_0, STEP_BUTTON_1, STEP_WIZARDS_1, STEP_SELECTOR_1, STEP_SLIDER_1, STEP_JOG_1 +variable_a: 1 +variable_b: 2 + +[wizard_step STEP_0] +image: path/to/image/wizard/STEP_0 +landscape: false +description: description STEP_0 +warning: warning STEP_0 +countdown: 10 +info: info about STSTEP_0 +action_gcode: + SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.wizard_step_name} + {action_respond_info('-------------------start STEP_0')} +cancel_gcode: + {action_respond_info('------------------CANCEL STEP_0')} + RESET_WIZARD WIZARD={wizard.name} + +[wizard_step_button STEP_BUTTON_1] +image: path/to/image/wizard/STEP_BUTTON_1 +landscape: false +description: description STEP_BUTTON_1 +warning: warning STEP_BUTTON_1 +countdown: 20 +info: info about STEP_BUTTON_1 +button_button_1_gcode: + {action_respond_info('-------------------button_button_1_gcode')} +button_button2_gcode: + {action_respond_info('-------------------button_button2_gcode')} +action_gcode: + {action_respond_info('-------------------action_gcode STEP_BUTTON_1')} + SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.wizard_step_name} +cancel_gcode: + {action_respond_info('------------------cancel_gcode STEP_BUTTON_1')} + RESET_WIZARD WIZARD={wizard.name} + +[wizard_step_wizards STEP_WIZARDS_1] +image: path/to/image/wizard/STEP_WIZARDS_1 +landscape: false +description: description STEP_WIZARDS_1 +warning: warning STEP_WIZARDS_1 +countdown: 20 +info: info about STEP_WIZARDS_1 +wizards: wizard1, wizard2 +action_gcode: + {action_respond_info('-------------------action_gcode STEP_WIZARDS_1')} + SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.wizard_step_name} +cancel_gcode: + {action_respond_info('------------------cancel_gcode STEP_WIZARDS_1')} + RESET_WIZARD WIZARD={wizard.name} + +[wizard_step_selector STEP_SELECTOR_1] +image: path/to/image/wizard/STEP_SELECTOR_1 +landscape: false +description: description STEP_SELECTOR_1 +warning: warning STEP_SELECTOR_1 +countdown: 20 +info: info about STEP_SELECTOR_1 +items: item1, item2, item3 +select_gcode: + {action_respond_info('-------------------select_gcode STEP_SELECTOR_1 selected=%s, wizard=%s' % (selected, wizard.name))} +action_gcode: + {action_respond_info('-------------------action_gcode STEP_SELECTOR_1')} + SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.wizard_step_name} +cancel_gcode: + {action_respond_info('------------------cancel_gcode STEP_SELECTOR_1')} + RESET_WIZARD WIZARD={wizard.name} + # HOME_POSITION ABORT=1 + +[wizard_step_slider STEP_SLIDER_1] +image: path/to/image/wizard/STEP_SLIDER_1 +landscape: false +description: description STEP_SLIDER_1 +warning: warning STEP_SLIDER_1 +countdown: 20 +info: info about STEP_SLIDER_1 +slider_slider1_min: 0 +slider_slider1_max: 100 +slider_slider1_step: 1 +slider_slider1_default: 20 +slider_slider_2_min: 4 +slider_slider_2_max: 30 +slider_slider_2_step: 23 +slider_slider_2_default: 20 +action_gcode: + {action_respond_info('-------------------action_gcode STEP_SELECTOR_1')} + SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.wizard_step_name} +cancel_gcode: + {action_respond_info('------------------cancel_gcode STEP_SELECTOR_1')} + RESET_WIZARD WIZARD={wizard.name} + # HOME_POSITION ABORT=1 + +[wizard_step_jog STEP_JOG_1] +image: path/to/image/wizard/STEP_JOG_1 +landscape: false +description: description STEP_JOG_1 +warning: warning STEP_JOG_1 +countdown: 20 +info: info about STEP_JOG_1 +axes: x, y, z, a, c +steps: 0.1, 1, 10, 20 +default_step: 10 +jog_gcode: + {action_respond_info('-------------------jog_gcode STEP_JOG_1 (G1 %s%s, direction=%s)' % (axis|upper, step, direction))} +action_gcode: + {action_respond_info('-------------------action_gcode STEP_JOG_1')} + SET_WIZARD_ENABLE WIZARD=CALIBRATE ENABLE=1 ERROR=error_message + SET_WIZARD_STEP WIZARD={wizard.name} STEP={wizard.wizard_step_name} +cancel_gcode: + {action_respond_info('------------------cancel_gcode STEP_JOG_1')} + RESET_WIZARD WIZARD={wizard.name} + # HOME_POSITION ABORT=1 + + +# ???????????????????????????????? + +# [wizard_step_material-selector material-selector_1] +# image: path/to/image/wizard/STEP_JOG_1 +# landscape: false +# description: description STEP_JOG_1 +# warning: warning STEP_JOG_1 +# countdown: 20 +# info: info about STEP_JOG_1 +# axes: x, y, z, a, c +# steps: 0.1, 1, 10, 20 +# default_step: 10 +# jog_gcode: +# {action_respond_info('-------------------jog_gcode STEP_JOG_1 axis=%s, step=%s,' % (axis, step))} +# action_gcode: +# {action_respond_info('-------------------start STEP_JOG_1')} +# cancel_gcode: +# {action_respond_info('------------------CANCEL STEP_JOG_1')} +# RESET_WIZARD WIZARD={wizard.name} +# # HOME_POSITION ABORT=1 \ No newline at end of file