Two custom controls using same slider input

I have created two custom controls with a slider, as shown below

Screenshot 2021-01-04 122002

These controls work fine - no problem. However, I would like to add another button (for 'UNload) that uses the same temperature parameter from the slider as the 'Load Filament' button. Is there any way to do that?



This one is a little bit harder to accomplish Frank, but I think might be possible using a javascript type command button and an inline javascript function to get a handle on the slider and pull it's value and then send the command using javascript instead of as a gcode. It would take some advanced js programming techniques which would require time to figure out.

Thanks for the info. Yeah, I figured it was in the "too hard" category, so I did four separate commands, each with their own slider.


I actually had this in my dev environment from when I was helping someone out. Just to give you an idea of how it could be done...this one doesn't send a command, but actually posts and API command to a plugin back-end. You would replace the OctoPrint.simpleApiCommand part with something like

OctoPrint.control.sendGcode($("#control-jog-custom > div > div > div > form > div > input[type=number]").val()});)
-   children:
    -   additionalClasses: row-fluid
        -   default: 100
            parameter: feed_rate
                max: 200
                min: 0
                step: 1
        javascript: 'OctoPrint.simpleApiCommand("my_endpoint", "my_command", {"parameter":
            $("#control-jog-custom > div > div > div > form > div > input[type=number]").val()});'
        name: Test Button
        type: javascript
        width: 3
    layout: horizontal_grid
    name: Test