Hi
I am just feeling my way with Ignition 8. I need a login button, that brings up a number pad to enter a 6 digit code. Once the correct password is entered a button will be enabled to change the status on each press between cleaning mode or available. Can someone give me a clue how I start to do this.
Thanks Laurie
It might help to clarify whether you are using Vision or Perspective to accomplish this.
Perspective is what I am using.
Okay, I can help with that.
Your example is a little unclear as to how you want items arranged and what buttons need to be in what Views, but this process should get you on your way:
- Before creating any Views, click the gear icon present in the Perspective workspace context toward the bottom of the Designer in the central panel.
- If you don’t see a panel called the “Perspective Property Editor”, use the Designer menu to open it, and scroll down to the bottom of the editor so that you can see
SESSION CUSTOM
.
- Click the “Add Custom Property” and select “value”.
- Right-click the “key” and supply a key name of “cleaningAvailable”.
- Click into the accompanying value area and set the value to “false”.
- Create two Views, “ViewMain” and “NumPadPopup”.
- In ViewMain, place a Button component.
- Right-click the Button and select “Configure Events…”.
- Select the
onActionPerformed
Event.
- Click the “+” icon, and then select the Popup Action.
- In the “Select View” dropdown, select the NumPadPopup View.
- Set the Identifier field to a value of “NUMPADPOPUP”.
- Set the Title to whatever you want.
- Click OK to save the changes.
- Place a second button which will be your cleaning/available button.
- On this new button, set
props.enabled
to value of “false”.
- (I’m going to take tis opportunity to push the Ignition Exchange because I have personally already made a keypad available for public use).
- Select the NumPadPopup View.
- In the property Editor, add a new custom property and provide it a key of
passcode
and a value of an empty string (just delete the value it has right now).
- Now, in NumPadPopup, place 1 button.
- Set
props.text
to a value of 0
.
- Right-click the Button and select “Configure Events…”.
- Use the onActionPerformed Event again, but this time select the Script Action.
- Use the following code for the script:
self.view.custom.passcode = str(self.view.custom.passcode) + str(self.props.text)
- Now copy this button nine times, and be sure to change the text of each button to be the next number (so that you have 0-9)(You do NOT need to change the script at all).
- Place two more buttons, and set their text properties to be “Clear” and “Enter”.
From this point, you only need to do three things, and how you do them is up to you:
- The clear button will need a script which uses the following script:
self.view.custom.passcode = ''
.
- The Enter button will need a script which compares the current passcode (
self.view.custom.passcode
) against the expected passcode (I don’t know if this is project or user specific, or even where you’re storing this value).
- The Enter button will also need two more lines of code which should be invoked ONLY if the passcode matches the expected value:
self.session.custom.cleaningAvailable = True # make sure "True" is capitalized here!
system.perspective.closePopup(id='NUMPADPOPUP') # make sure this is al caps to match what you set earlier!
Hi, i am also struggling to get a password setup for button that can allow anyone to move some manual motions. I am using Vision and have already created all pages in ignition softwares. I just need something to prevent someone from going into manual motion screen without login. Can you please help me out with that ?