Is there any way to display a user selectable list of options
-
I'm not sure if Gcode meta commands is the right forum section for this so mods feel free to move this post.
It's probably best if I simply describe the use case. I have a number of "Pre-Print" macros which take care of everything to prepare the printer from power up to the gcode proper running. My slicer start gcode simply has one line eg M98 P"Pre-PrintASA.g" (the macros are in the sys directory so there is no path). These macros do different things depending on the filament type and I have a 6 input multi-material hot end. So if I want to print the same part again, starting with a different material, all I need do is edit the macro call in the gcode file to (say) Pre-print ABS.g".
I'd like to simplify this even more by having DWC show a list of filaments that I can select one from . E.g. 1 = ABS, 2 = PLA, 3 = TPU, etc. The plan would be to use a variable (probably global) and assign it a value depending on the selection made. Then I could use a "universal" pre-print macro which I wouldn't need to edit, along the lines of "If variable) =1, M98 P "Pre-PrintABS.g, else if variable = 2 M98 P"Pre-PrintPLA.g" etc.
-
@deckingman
Your options are to either
1: create macros in the 0:/macros directory. If they are in the root of this directory the will appear as buttons in DWC and PanelDue. The macro would update the global variable
2: Use the DWC filament functionality.
You can use the config.g in each filament to update the global variable along with any other filament specific parameters.I use the latter method.
On startup I set the global to the same as what is stored in DEC, which stores it in filaments.csv -
@deckingman You can do this with BtnCmd:
- Create the global variable.
- In BtnCmd Add a Input Panel and configure as selection eg:
- Create the selection values:
- Once saved you will have a selection list in the UI like this:
After making the selection the Global Var will be updated:
Hope this helps.
-
This post is deleted! -
@MintyTrebor - Please say a little more about this - I'm assuming this is somehow editing the DWC code, and not something that can go into a gcode macro. Or is there a way to integrate them (the gcode macro sets some global variables and the DWC code looks at them to build the menu options?) And how could the be translated into PanelDue display.
An answer like - "you'll need to learn about coding in X Y and Z languages, and be prepared to perform the following steps when a new version of DWC and/or Panel Due are released" Please help us learn how big this hill is what we need to learn to climb it.
-
@Arnold_R_Clark No.
@mikeabuilder BtnCmd is a DWC plugin - it runs in the browser. Everything I showed above was generated by the plugin and runs in the browser (with the exception of the Global Variables). When the user selects an option, the value of the option is assign to the global variable by executing the standard command:
set global.varname = ####
The Global variables can be used in Macros and other gcode.
BtnCmd does not work on Panel Due.
There is a wiki if you want to see the full range of features it offers.If you want to learn about how to write DWC or DSF plugins here is a good place to start.