You are on page 1of 3

------------------------------------------------------------------------

--
-- Copyright 1974 to current year. AVEVA Solutions Limited and its subsidiaries.
All rights reserved in original code only.
--
-- File: admextractconnections.pmlfrm
-- Type: Form Definition
-- Group: PDMS Global Administration Application

-- Keyword: GLOBAL
-- Module: admin
-- Replaces:
--
-- Author: S.Bentley
-- Created: Wed Dec 5 11:31:06 BST 2001
--
--
-- Description:
-- form to display the connection elements for an element to be flushed / issued
--
------------------------------------------------------------------------
--
-- Methods defined:
--
-- Method call Return Description
-- =========== ====== ===========
-- admExtractConnections() - Constructor
-- initialise() - Initialisation for form
--

setup form !!admExtractConnections

!this.formTitle = 'Changed Rules & Connections'


!this.iconTitle = 'Connection'
!this.callback = '!this.initialise()'
!this.formRevision = ' $Revision: 1.3 $ '

button .ce 'Update List' at x0 ymax call |!this.initialise()| tooltip 'Update the
list based on the selections on the Extract Data Control form'
toggle .recursive 'Recursive Changes' at xmax+3 ymin tooltip 'The
Flush/Issue/Drop will ALWAYS act recursively. This option effects the view only'
paragraph .element at x0 ymax+0.2 width 49

list .list '' call || at x0 ymax width 47 length 12

paragraph .resultsListed at x0 ymax width 48


paragraph .results at x0 ymax width 49

member .elementDBRef is DBREF

exit
-- End of form definition for !!admExtractConnections
------------------------------------------------------------------------
--
-- Method: admExtractConnections
--
-- Description: Constructor
--
-- Method Type: Function/Procedure
-- Arguments:
-- [#] [R/RW] [Data Type] [Description]
-- Return:
-- [Data Type] [Description]
--
------------------------------------------------------------------------

define method .admExtractConnections()

-- Populate the toggle gadget


!this.recursive.val = true

endmethod
-- End of method definition for .admExtractConnections()
------------------------------------------------------------------------
--
-- Method: initialise
--
-- Description: Initialisation for form
--
-- Method Type: Function/Procedure
-- Arguments:
-- [#] [R/RW] [Data Type] [Description]
-- Return:
-- [Data Type] [Description]
--
------------------------------------------------------------------------

define method .initialise()

!connections = ARRAY()
!connectionsTrimmed = ARRAY()
!dText = ARRAY()

-- Which pseudo attribute to use


if (!this.owner().connectionAllChanges.val.not()) then
if (!this.owner().singleToggle.val.eq(TRUE)) then
!connections = !this.owner().list.selection().dbref().extrcn
else
!connections = !this.owner().list.selection().dbref().exhrcn
endif
else
if (!this.owner().singleToggle.val.eq(TRUE)) then
!connections = !this.owner().list.selection().dbref().extrco
else
!connections = !this.owner().list.selection().dbref().exhrco
endif
endif

-- Total number of elements listed based on recursive selection


if (!this.recursive.val.not()) then
if (!this.owner().connectionAllChanges.val.not()) then
if (!this.owner().singleToggle.val.eq(TRUE)) then
!connectionsTrimmed = !this.owner().list.selection().dbref().extcnn
else
!connectionsTrimmed = !this.owner().list.selection().dbref().exhcnn
endif
else
if (!this.owner().singleToggle.val.eq(TRUE)) then
!connectionsTrimmed = !this.owner().list.selection().dbref().extcon
else
!connectionsTrimmed = !this.owner().list.selection().dbref().exhcon
endif
endif
endif

if (!this.recursive.val) then
!this.resultsListed.val = 'Elements listed (recursive) = ' & !
connections.size()
-- Get the full names of the elements of the array
do !i indices !connections
!dText[!i] = !connections[!i].fullname
enddo
else
!this.resultsListed.val = 'Elements listed (not recursive) = ' & !
connectionsTrimmed.size()
-- Get the full names of the elements of the array
do !i indices !connectionsTrimmed
!dText[!i] = !connections[!i].fullname
enddo
endif
!this.results.val = 'Actual Elements for Flush/Issue/Drop = ' & !
connections.size()

-- What is the current element


!this.elementDBRef = !this.owner().list.selection('RTEXT').dbref()
!this.element.val = !this.elementDBRef.namn

-- Put the collected elements into the list gadget


!this.list.dText = !dText

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

You might also like