Page 1 of 1

M1 Stop save setting

PostPosted: Sat Jan 28, 2017 2:55 am
by ger21
I added an M1 toggle button to my screen (#561).
It defaults to On when starting UCCNC, and it's state does not appear to be saved in the profile.
I tried:
AS3.Switchbutton(false,561);
in both the constructor macro and the .ssf file, but it always defaults to On.

Can we either get button #561to default to Off? Or have it's state saved in the profile?

Re: M1 Stop save setting

PostPosted: Sat Jan 28, 2017 3:12 am
by cncdrive
Gerry,

The exec.Switchbutton only changes the visual state of the button and the visual state change can be handled separately to let the programmers control the visual state of custom buttons based on their functions' states.
I mean for example a macro can change a custom toggle type button state to on off based on if the programmer's function could do and finish different things.
In other words it is not mandatory that a button should always change it's visual state when the button is pressed.

To switch the M1 button state you should execute the exec.Callbutton function on the button code.
You could do it in the constructor macro and then the M1 button could be switched off on startup.

Re: M1 Stop save setting

PostPosted: Sat Jan 28, 2017 11:48 am
by ger21
My mistake. Thanks.