1. Create two popup windows named 1001 and 1002 under the "Popup windows / Action confirmation" section, as shown in Figures 1 and 2. The password input box includes a blue rectangle and a password display area. This password display function is located at Toochest/Miscellaneous/PassDisp-0001-01. In the property settings, set the variable to String01 and the status to String02.
Figure 2 shows the screen for the 1002 Popup window. Place the login button on the main system login screen, as displayed in Figure 3.
2. Define four internal variables:
- The "PasswordString" attribute is set to String/Internal with an initial value of "210", which represents the default password.
- The "String01" attribute is set to String/Internal.
- The "String02" attribute is also set to String/Internal.
- The "Protected" variable is set to Discrete/Internal with an initial value of "off".
3. Create the following script within the 1001 window:
String Original, Edited;
Boolean IsValidPassword = false;
Original = PasswordString.getStringValue();
Edited = String01.getStringValue();
if (Edited.compareTo(Original) == 0) {
if (ProtectedVariable.getIntValue() == 1) {
ProtectedVariable.write(0);
} else {
ProtectedVariable.write(1);
}
Actionconfirmation.move(0, 0, 640, 480);
actionconfirmation.changePanel(41);
} else {
actionconfirmation.changePanel(10002);
}
This script compares the entered password with the stored one. If they match, it toggles the protected state and navigates to the next panel. If not, it redirects to the error panel.
Electric Motor For Card Steering Equipment
Electric Motor For Card Steering Equipment,Reliable Electric Motor,Electric Motor For Card Steering,Durable Mining Equipment
Jiangsu Hengchi Motor Technology Co., Ltd , https://www.hcemotor.com