New Innonation for PDMS Login of AVEVA

 
  • Can you show me the name of login form?
    Thanks,
  • the location file is C:\AVEVA\Plant\PDMS12.0.SP6\PMLLIB\monitor\forms\


    Thanks you!
  • ------------------------------------------------------------------------
    --
    -- (c) Copyright  1997 to Current Year  AVEVA Solutions Limited
    --
    -- File:            pdmslogin.pmlfrm
    --   Type:          Form Definition
    --   Group:         General Application
    --     Keyword:     GEN
    --   Module:        monitor
    --   Replaces:      FLOGIN
    --
    -- Modified:        Mansyur Usman
    -- Author:          E.conba
    -- Created:         Tue Jan 28 08:47:01 GMT 1997
    --
    --
    -- Description:
    -- Definition of PDMS Login form.
    --
    ------------------------------------------------------------------------
    --
    -- Methods defined:
    --
    --  Method call                      Return              Description
    --  ===========                      ======              ===========
    --  cancel()                         -                   action for ok button
    --  init()                           -                   constructor
    --  ok()                             -                   action for ok button
    --  pdmsLogin()                      -                   constructor
    --  selectMdb()                      -                   action for mdb
    --  selectModule()                   -                   action for modules option gadget
    --  setMdb()                         -                   action for setting mdb
    --  setPassword()                    -                   action to set the users password
    --  setProject()                     -                   action setting the project
    --  setUserName()                    -                   action for setting userName and checking for Authentication
    --  textWidth()                      -                   --
    --
     


     setup form !!pdmsLogin SIZE 10 13
     Var !UserName Login
     Var !UserName UpCase(|$!UserName|)

     member .loadMenuFlag is ARRAY
     member .reLogin is BOOLEAN
     member .authentication is BOOLEAN
     member .projList is ARRAY
     member .chPass is BOOLEAN
     -- Body of form definition
     text   .projName  at xmin ymax+0.2 |Project   |  width 20 string
     button .pSel at xmax ymin pixmap width 9 height 12
     paragraph .project  at xmax+2 ymin text |!this.project| width 4

     text   .userName at xmin.projName ymax.projName |Username  | width 20 string
     button .uSel at xmax ymin pixmap width 9 height 12

     text   .passwd   at xmin.projName ymax.userName |Password  | width 20 noecho string
     button .changePass at xmax ymin |Change|

     text   .mdb     at xmin.projName ymax+0.5 |MDB       |  width 20 string
     button .mdbForm at xmax ymin pixmap width 9 height 12

     option .modules 'Module    ' at xmin.projName ymax.mdb  width 15
     toggle .readOnly 'Read Only' at xmax ymin

     toggle .restore 'Restore Views' at xmin.projName ymax.modules
     -- Display command line based on environment variable setting
     var !displayEvar evar pdmslogincommandline
     if (!displayEvar.upcase() eq 'YES') then
       view .term at xmin.projName ymax+0.5 alpha
         height 10 width 40
         channel commands
         channel requests
       exit
     endif

     button .ok at xmin.projName ymax+0.5 |  OK  |
     button .ind at xmin+9 ymin |We are PDMS Indonesia| callback|!!Alert.message ('We are Proud of Indonesia Nation')|backg magenta
     button .cancel at xmax form-size ymin |Cancel| cancel

    if !UserName.eq ('MANSYUR.USMAN') then
    BUTTON.Apply1 AT X 0.1 Y 8 PIXMAP /O:\PDMS\PMLLIB\picture\MAN.BMP callback|!!Alert.message ('MY Name is $!UserName')|
    paragraph.par1 at 18 9 text    |MANSYUR USMAN|
    paragraph.par2 at 18 9.7 text  |SR PDMS-E3D ADMINISTRATOR|
    paragraph.par3 at 18 10.4 text |INDONESIA|

    elseif !UserName.eq ('MUSOFAN') then
    BUTTON.Apply2 AT X 0.1 Y 8 PIXMAP /O:\PDMS\PMLLIB\picture\MSF.BMP callback|!!Alert.message ('MY Name is $!UserName')|
    paragraph.par4 at 18 9   text  |MUSOFAN,ST|
    paragraph.par5 at 18 9.7 text  |SENIOR PRINCIPLE PIPING DESIGNER|
    paragraph.par6 at 18 10.4 text |INDONESIA|


    else
    BUTTON.Apply16 AT X 0.1 Y 8  PIXMAP /O:\PDMS\PMLLIB\picture\AAA.BMP callback|!!Alert.message ('MY Name is $!UserName')|
    paragraph.par31 at 18 9 text    |$!UserName|
    paragraph.par32 at 18 9.7 text  |OTHERS USER|
    paragraph.par33 at 18 10.4 text |INDONESIA|

    endif
    exit
    -- End of form definition for !!pdmsLogin

    ------------------------------------------------------------------------
    --
    -- Method:      !pdmsLogin()
    --
    -- Description: constructor
    --
    -- Method Type: Procedure
    --
    -- *** OLD STYLE PML ***
    -- *** COMMAND LINE SYNTAX ***
    --
    ------------------------------------------------------------------------
    define method .pdmsLogin()
     -- For Marine Header
     Var !UserName Login
     Var !UserName UpCase(|$!UserName|)

     var !marine evar  'AVEVA_MARINE'
     if(!marine.upcase().eq('YES')) then
       !this.formTitle = 'AVEVA MARINE Login'
     else
       !this.formTitle = 'PDMS Login for Training Project'
     endif

     !this.iconTitle     = 'AVEVA Login'
     !this.callback      = '!this.init()'
     !this.formRevision  = ' $Revision: 1.28 $ '

     !comboBoxIcon = !!pml.getPathName('comboboxarrow9x12.png')
    -- callbacks
     !this.projName.callback   = |!this.setProject()|
     !this.pSel.callback       = |show !!selectProject|
     !this.userName.callback   = |!this.setUserName()|
     !this.uSel.callback       = |show !!selectuser|
     !this.passwd.callback     = |!this.setPassword()|
     !this.changePass.callback = |show !!changePass|
     !this.mdb.callback        = |!this.setMdb()|
     !this.mdbForm.callback    = |!this.selectMdb()|
     !this.modules.callback    = |!this.selectModule()|

     !this.cancelCall = '!this.cancel()'
     !okMacro = !!pml.getPathName('pdmsloginok.pmlfnc')
     !this.ok.callback = '$m "' + !okMacro + '"'
     !this.pSel.addPixmap(!comboBoxIcon)
     !this.uSel.addPixmap(!comboBoxIcon)
     !this.mdbForm.addPixmap(!comboBoxIcon)
     !this.projName.validatecall   =   '!this.textWidth()'

     -- initialise the modules option gadget
     !dText = ARRAY()
     !rText = ARRAY()
     !this.loadMenuFlag = ARRAY()
     !!modulesArray = !!moduleData()
     do !moduleDef values !!modulesArray
       skip if (!moduleDef.command.upcase() eq 'SUBMENU')
       if (!moduleDef.gui and !moduleDef.restore) then
         !this.loadMenuFlag.append(true)
       else
         !this.loadMenuFlag.append(false)
       endif
       !dText.append(!moduleDef.dText)
       !rText.append(!moduleDef.command.upcase())
     enddo
     !this.modules.dText = !dText
     !this.modules.rText = !rText

     !this.reLogin = false

    endmethod
    -- End of method definition for .pdmsLogin()

    ------------------------------------------------------------------------
    --
    -- Method:      !init()
    --
    -- Description: constructor
    --
    -- Method Type: Procedure
    --
    -- *** OLD STYLE PML ***
    -- *** COMMAND LINE SYNTAX ***
    --
    ------------------------------------------------------------------------
    define method .init()

     -- pause to allow the splashScreen to be displayed prior to this form.
     PAUSE 2

     !this.projName.val  = ''
     !this.project.val  = ''
     !this.userName.val = ''
     !this.passwd.val   = ''
     !this.mdb.val      = ''

     if (!!sessionSettings.project.empty()) then
       !this.keyboardFocus = !this.projName

     else
       !this.projName.val = !!sessionSettings.projName
       !this.project.val = !!sessionSettings.project

       if (!!sessionSettings.user.empty()) then
         !this.keyboardFocus = !this.userName

       else
         !this.userName.val = !!sessionSettings.user
         !this.keyboardFocus = !this.passwd

         if (!!sessionSettings.mdb.empty().not()) then
           !this.mdb.val = !!sessionSettings.mdb.substring(2)
         endif
       endif
     endif

     !this.modules.select('rtext', !!sessionSettings.module.upcase())
     handle any
     endhandle
     !this.selectModule()
     -- Only activate the Change Password button once the users password
     !this.changePass.active=false
     !this.setUserName()

     !this.restore.val = !!sessionSettings.restore
     handle any
       !this.restore.val = false
     endhandle

     !this.readOnly.val = !!sessionSettings.readOnly
     handle any
       !this.readOnly.val = false
     endhandle

     -- Initialise activation of gadgets based on restored module selection
     !this.selectModule()

     !this.authentication = authentication

     !!runMacro('%PDMSDFLTS%/mon-admin.pmldat','')
     handle ANY
       -- Just in case the file has been deleted set the password to false
       !this.chPass = FALSE
     elsehandle NONE
       !this.chPass = !!monAdminDflts.chPass
     endhandle

    endmethod
    -- End of method definition for .init()

    ------------------------------------------------------------------------
    --
    -- Method:      !selectModule()
    --
    -- Description: action for modules option gadget
    --
    -- Method Type: Procedure
    --
    -- *** OLD STYLE PML ***
    -- *** COMMAND LINE SYNTAX ***
    --
    ------------------------------------------------------------------------
    define method .selectModule()

     if (!this.loadMenuFlag[!this.modules.val]) then
       !this.restore.active = true
     else
       !this.restore.active = false
     endif
     -- check that the user save file exists if it doesn't then switch restore to false and grey it out
     -- this doesn't work until the user has been set so handle the error the first time you enter the form
     !userName       = !this.userName.val
     !modKey=!!modKey(!this.modules.selection())
     !dispFileObj = object FILE('%PDMSUSER%/' + !modKey + '-' + !this.project.val.lowcase() + '-' + !this.mdb.val + '-gphviews.pmldat')
     if (!dispFileObj.exists().not()) then
       !this.restore.val = false
       !this.restore.active = false
     else
       !this.restore.active = true
     endif

     if (!this.modules.selection().upcase() eq 'MONITOR') then
       !this.readOnly.active = false
     else
       !this.readOnly.active = true
     endif


    endmethod
    -- End of method definition for .selectModule()
    ------------------------------------------------------------------------
    --
    -- Method:      !setUserName()
    --
    -- Description: action for setting userName and checking for Authentication
    --
    -- Method Type: Procedure
    --
    --
    ------------------------------------------------------------------------
    define method .setUserName()

     !userNameList=ARRAY()
     !this.authentication = false

     !authentication=authentication
     if (!authentication) then
       -- Is this user authenticated
       !authUser=object authuser()
       !userNames=!authUser.userList()
       handle (2,109)
         -- Not an authenticated user
         !this.passwd.setFocus()
         !this.authentication=false
         !this.changePass.active=false
       elsehandle none
          -- Does the username in the form match any of the authenticated users
          do !i index !userNames
            !userNameList[!i] = !userNames[!i].name
          enddo
          -- This is an authenticated user but is the username FREE if so we still need a password
          -- If not then no password is required
          !userNo=!userNameList.findFirst(!this.userName.val)
          if(!userNo.set()) then
             --is this a free user
             if (!userNames[!userNo].access.upcase() eq 'FREE') then
              -- password required
              !this.passwd.active=true
              !this.passwd.setFocus()
              !this.authentication=false
              !this.changePass.active=false
             else
              !this.passwd.val=''
              !this.passwd.active=false
              !this.mdb.setFocus()
              !this.authentication=true
              !this.changePass.active=false
             endif
          else
             -- set the user name to the default user
             !this.userName.val=!authUser.defaultUser().name
             handle any
               -- password required
               !this.passwd.active=true
               !this.passwd.setFocus()
               !this.authentication=false
               !this.changePass.active=false
             elsehandle none
               --is this a free user
               !user=object user(!this.userName.val)
               if (!user.access.upcase() eq 'FREE') then
                 -- password required
                 !this.passwd.active=true
                 !this.passwd.setFocus()
                 !this.authentication=false
                 !this.changePass.active=false
               else
                 !this.passwd.val=''
                 !this.passwd.active=false
                 !this.mdb.setFocus()
                 !this.authentication=true
                 !this.changePass.active=false
               endif
             endhandle
          endif
       endhandle

     else

       !this.passwd.setFocus()
       !this.authentication=false
       !this.changePass.active=false

     endif
     !userName = !this.userName.val
       -- check that the user save file exists if it doesn't then switch restore to false and grey it out
     !modKey=!!modKey(!this.modules.selection())
     !dispFileObj = object FILE('%PDMSUSER%/' + !modKey + '-' + !this.project.val.lowcase() + '-gphviews.pmldat')
     if (!dispFileObj.exists().not()) then
       !this.restore.val = false
       !this.restore.active = false
     else
       !this.restore.active = true
     endif

     !!sessionSettings.user   = !this.userName.val

    endmethod

    -- End of method definition for .setUserName()
    ------------------------------------------------------------------------
    --
    -- Method:      !setPassword()
    --
    -- Description: action for setting password
    --
    -- Method Type: Procedure
    --
    --
    ------------------------------------------------------------------------
    define method .setPassword()

     -- Get the variable from the form
     !userName = !this.userName.val
     !password = !this.passwd.val

     !user = object USER(!userName)

     -- Check that the username is set
     if (!userName.empty()) then

       !this.passwd.val = ||
       !!messageFile.error(150, 22)

     endif

     -- Try and set username and password
     if (!this.authentication and !user.access.upcase() eq 'GENERAL') then

       !userPass = '|' & !userName & '|'

     else

       !userPass ='|' & !userName & '|' & '/' & !password


     endif

     USERNAME $!userPass

     handle none

       !!sessionSettings.user  = !this.userName.val
       !this.mdb.setFocus()
       if (!!monAdminDflts.chPass or !user.access.upcase() eq 'FREE') then
         !this.changePass.active=!this.passwd.active
       else
         !this.changePass.active= FALSE
       endif


     elsehandle (43,258) (47,15) (1,251)

       -- Bad username or password
       !this.passwd.val = ||
       !this.passwd.setFocus()
       !!messageFile.error(150, 21)

     elsehandle (98,205)

       -- Project is locked
       !!messageFile.error(150, 43, !this.project.val)
       !this.project.val  = ||
       !this.userName.val = ||
       !this.passwd.val   = ||
       !this.project.setFocus()

     elsehandle (98,204)

       -- Project max users setting has been reached.
       !this.userName.val = ||
       !this.passwd.val   = ||
       !this.userName.setFocus()
       !!messageFile.error(150, 44, !this.project.val)

     elsehandle any

       !!alert.error(!!error.text.after(|)|))
       !this.userName.val = ||
       !this.passwd.val   = ||
       !this.userName.setFocus()

     endhandle


    endmethod

    -- End of method definition for .setPassword()

    ------------------------------------------------------------------------
    --
    -- Method:      !setProject()
    --
    -- Description: action for setting project
    --
    -- Method Type: Procedure
    --
    --
    ------------------------------------------------------------------------
    define method .setProject()

     !oldProject = !!currentProject
     !idEvar     = !oldProject & '000id'
     var !id evar '$!idEvar'
     !found=false
     !projList = PROJECTS
     if (!projList.size() eq 0) then
       !!alert.error('No projects defined')
       return
     endif
     var !unusedP proj
     --DFN 10273
     -- Fix to get round unhandled exception when no project set
     handle (43,251) (39,33) (39,32)
       !code = !projList[1].code()
       PROJ $!code
     endhandle
     do !i indices !projList
        if (!projList[!i].id().unset()) then
           if (!projList[!i].code().upcase() eq !this.projName.val.upcase()) then
              !project=!projList[!i].code().upcase()
              !found=true
              break
           endif
        elseif (!projList[!i].code().upcase() eq !this.projName.val.upcase() or !projList[!i].id().upcase() eq !this.projName.val.upcase()) then
           !project=!projList[!i].code().upcase()
           !found=true
            break
        endif
     enddo
     if (!found.not()) then
        -- Project not found
        !!alert.error('Project not defined')
        !project=!this.project.val
        if (!id eq '') then
          !this.projName.val = !project
        else
        !this.projName.val = !id
     endif
     endif

     -- Try to set the project
     if (!project ne !!currentProject) then
       PROJECT $!project
       handle (43,252)

         !!messageFile.warning(150, 045, !project)

       elsehandle (43,9)

         !!messageFile.warning(150, 042, !project)

       elsehandle (43,260) (43,253) (39,33) (39,32)

         !error = !!error.text.after(|)|)
         !!alert.error(!error)

       elsehandle any

         !!messageFile.warning(150, 041, !project)

       elsehandle none

         !this.project.val    = !project.upcase()
         !!currentProject = !project.upcase()
       -- can not use current project because the user name will not be set so have to go round all the projects
       -- and find out the current project that way
       !projList = PROJECTS
       do !i indices !projList
          if (!projList[!i].evar.substring(1,3).upcase() eq !project.upcase()) then
             !projid=!projList[!i].id()
          endif
       enddo
         !this.projName.val = !projid
         !!sessionSettings.project  = !project
         !!sessionSettings.projName  = !projid

         -- clear MDB for new project
         !this.authentication  = false
         !this.passwd.active   = true
         !this.changePass.active = false
         !!sessionSettings.mdb = ||
         !this.mdb.val         = ||
         !this.userName.val    = ||
         !this.passwd.val      = ||
         !this.userName.setFocus()

       endhandle
       if (!project.upcase() neq !oldProject.upcase()) then
        -- clear MDB for new project
         !!sessionSettings.mdb      = ||
         !this.mdb.val        = ||
         !this.userName.setFocus()
       endif
     else

       -- Hide the form if displayed and loaded
       if (defined(!!selectProject)) then
          if (!!selectProject.shown()) then
             !!selectProject.hide()
          endif
       endif
     endif


    endmethod
    ------------------------------------------------------------------------
    --
    -- Method:      !setMdb()
    --
    -- Description: action for setting mdb via text gadget
    --
    -- Method Type: Procedure
    --
    --
    ------------------------------------------------------------------------
    define method .setMdb()

     !this.setProject()
     !this.setPassword()

     if (!this.mdb.val.trim() eq '') then
       !mdb = ''
     else
       !mdb = '/' + !this.mdb.val
     endif

     $!mdb
     handle any
       !this.mdb.val = ''
       !this.mdb.setFocus()
       !!alert.error(!!error.text)
     elsehandle none
       !this.ok.setFocus()
     endhandle

    endmethod
    -- End of method definition for .setMdb()

    ------------------------------------------------------------------------
    --
    -- Method:      !selectMdb()
    --
    -- Description: action for ok button
    --
    -- Method Type: Procedure
    --
    -- *** OLD STYLE PML ***
    -- *** COMMAND LINE SYNTAX ***
    --
    ------------------------------------------------------------------------
    define method .selectMdb()

     !this.setProject()
     !this.setPassword()
      show !!selectMdb

    endmethod
    -- End of method definition for .selectMdb()

    ------------------------------------------------------------------------
    --
    -- Method:      !ok()
    --
    -- Description: action for ok button
    --
    -- Method Type: Procedure
    --
    -- *** OLD STYLE PML ***
    -- *** COMMAND LINE SYNTAX ***
    --
    ------------------------------------------------------------------------
    define method .ok()

     if (!this.mdb.val.trim() eq '') then
       !mdb = ''
     else
       !mdb = '/' + !this.mdb.val
     endif

     !!login(!this.project.val, !this.userName.val + '/' + !this.passwd.val, !mdb, '')
     handle any
       show !!pdmsLogin
       !!alert.error(!!error.text)
     endhandle

    endmethod
    -- End of method definition for .ok()

    ------------------------------------------------------------------------
    --
    -- Method:      !cancel()
    --
    -- Description: action for ok button
    --
    -- Method Type: Procedure
    --
    -- *** OLD STYLE PML ***
    -- *** COMMAND LINE SYNTAX ***
    --
    ------------------------------------------------------------------------
    define method .cancel()

     if (!this.reLogin.not()) then
       !!fmsys.splashScreen(false)
       FINISH
     endif

    endmethod
    -- End of method definition for .cancel()
    ------------------------------------------------------------------------
    --
    -- Method:      textWidth()
    --
    -- Description: Checks for the no. of characters entered in the project name field.
    --
    -- Method Type: Function
    --
    -- *** OLD STYLE PML ***
    -- *** COMMAND LINE SYNTAX ***
    --
    ------------------------------------------------------------------------
    define method .textWidth()

     !this.project.val  =  !this.project.val.trim()

    endmethod
    -- End of method definition for .textWidth()
  • did maybe anyone found out how to change the form for 12.1?

    We have all projects added to one start script so this is something a bit tricki without a description.

    Looking forward to e3D for that matter then you have even a worse overview :-/
  • login is taking much time due to loading the libraries or dlls

    possbile to avoid any libraries to quick landing in design by avoiding below listed ? otherthen TTY?

    Initialisation

    Rulesetbrowseraddin

    Collections

    MessagesAddins

    LOADING APPLICATIONS

    UIC Files

    UILayout