AVEVA. PDMS. Paragon. Spec Viewer

2014-06-11_144542

 

————————————————————————



— File: uspecblockcreate.pmlfrm
— Type: PML Form Definition
— Group: forms
— Keyword: RPT
— Module: Paragon
— Replaces:

— Author: Me_hungry
— Created: Thu Mar 13 13:04:32 UTC+02:00 2014


— Description:
— Блочное добавление элементов спецификации(catspecviews.pmlobj)

————————————————————————

setup form !!uspecblockcreate size 50 10 resize

track |CATACE| call |!this.Tracker()|
title |Блочное пополнение спецификаций|
option .elementtypeopt at xmax call ‘!this.fillistspco()’ width 5 tooltip ‘Тип Элемента’
list .spreflist anchor L+R+T+B at x0 ymax+0.2 MULT width 45 lines 20.2

member .specification is CATSPECIFICATION
member .heading is SPECHEADING
exit
define method .uspecblockcreate()

endmethod

————————————————————————

— Method: MethodsName

— Description: Описание метода

————————————————————————
define method .Tracker()
if( !!ce.type ne ‘SPEC’ )then
return
endif
!elementtypeoptdtext = ARRAY()
— задать экземпляр обьекта спецификации
!this.specification = object CATSPECIFICATION(CE)

— колличество заголовков(типов элементов)
!headingCount = !this.specification.headingCount(true)
— экземпляры заголовков
if (!headingCount gt 0) then
do !hCnt from 1 to !headingCount
— задать экземпляр обьекта заголовки(типы элементов)
!this.heading = object SPECHEADING(!this.specification, !hCnt)
!headingcomponentcount = !this.heading.componentcount()
if(!headingcomponentcount gt 0)then
!componentType = object SPECCOMPONENT(!this.heading , 1)
— тип
!elementtypeoptdtext.append(!componentType.stringAnswer(1))
endif
enddo
!this.elementtypeopt.dtext = !elementtypeoptdtext
endif
endmethod
define method .fillistspco()
!spreflistdtext = ARRAY()
!queste = ‘NAME’
!ansva = ”
!heading = object SPECHEADING(!this.specification, !this.elementtypeopt.val)
!headingcomponentcount = !heading.componentcount()
do !cnt from 1 to !heading.questionsCount()
!queste = !queste + ‘ ‘ + !heading.question(!cnt) + ‘/’ + !heading.stringDefault(!cnt).replace(‘NONE’, ‘-‘).replace(‘EQUA’, ‘=’)
enddo
!this.spreflist.SetHeadings( !queste )

if(!headingcomponentcount gt 0)then
do !headingcomponentcountindex from 1 to !headingcomponentcount
— задать экземпляр обьекта spref
!component = object SPECCOMPONENT(!heading, !headingcomponentcountindex)
do !answercountval from 1 to !component.ANSWERCOUNT()
if(!answercountval.eq(1))then
— Get data type of answer
!answerType = !component.answerType(!answercountval)
— Get answer as STRING data type
if (!answerType eq |STRING|) then
!ansva = !component.stringAnswer(!answercountval)
elseif (!answerType eq |REAL|) then
!ansva = !component.realAnswer(!answercountval).string()
endif
else
!answerType = !component.answerType(!answercountval)
if (!answerType eq |STRING|) then
!ansva = !ansva + ‘ ‘ + !component.stringAnswer(!answercountval)
elseif (!answerType eq |REAL|) then
!ansva = !ansva + ‘ ‘ + !component.realAnswer(!answercountval).string()
endif
endif
enddo
!spreflistdtext.append(!component.name() + ‘ ‘ + !ansva )
enddo
!this.spreflist.dtext = !spreflistdtext
endif
endmethod
— !userHeadingsFile = object FILE(‘%PDMSUSER%/standard-headings’)
— !headingsFile = object FILE(‘%PDMSUI%/cat/dflts/standard-headings’)
— !readStandards = !headingsFile.readfile()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s