Page 1 of 1

Disable / Enable password inside a macro

PostPosted: Thu Jul 25, 2024 10:15 am
by fdeporte
Hi,
I am still working at ATC and probing macro and I would like to disable / enable the password inside the macro.

I have tested the following code but UCCNC still ask for password.

Code: Select all
string Password = DisablePassword();
DisableSoftLimits();
MessageBox.Show("Softlimits disabled.");
EnableSoftLimits();
MessageBox.Show("Softlimits enabled.");
EnablePassword(Password);

#Events

private void EnableSoftLimits(){
  AS3.Setcheckboxstate(true, 75);
  exec.Callbutton(168);
}

private void DisableSoftLimits(){
  AS3.Setcheckboxstate(false, 75);
  exec.Callbutton(168);
}

private string DisablePassword(){
  string Password = exec.Readkey("Operatorlock","Password","");
  if(Password!=""){
    exec.Writekey("Operatorlock","Password","");   
  }
  return Password;
}

private void EnablePassword(string Password){
    exec.Writekey("Operatorlock","Password",Password);
}



It's like UCCNC remember a password has been set without checking the key Password during macro.
Do you know how can I fix it ?

Thanks a lot,

Re: Disable / Enable password inside a macro

PostPosted: Thu Jul 25, 2024 9:39 pm
by cncdrive
Try to call the Applysettings button after changing the key in the profile file.
I'm not 100% sure if it will work, but try it please.

Re: Disable / Enable password inside a macro

PostPosted: Fri Jul 26, 2024 6:22 am
by fdeporte
I have tried by pressing Apply after Writekey function and I obtain the same result.
I would like to set password to afford my customers editing settings but I need macro with full rights for disable softlimits for example.
Do you know another way to disable password inside of macro ?

Re: Disable / Enable password inside a macro

PostPosted: Sun Aug 04, 2024 11:28 am
by Battwell
it would be nice to lock out customers from changing all settings (grey out all check boxes )
but still be able to save offsets, save settings etc from macros.
at the moment i cannot lock customers out of settings due to this.