New Text Document

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 21

-- Developer by Mansyur Usman (mansyur.usm@gmail.

com)

-- PML for creating spool drawing of Spooler Module in PDMS and Aveva E3D

-- Jakarta 14 - Sep - 2017

-- Sriwijaya University Palembang Indonesia

-- Motto : Islam is My Way and I am pround as a Muslim

kill!!msrspooler

setup form !!msrspooler size 39 23

!this .formtitle='UNSRI SPOOLER'

!!msrspooler.callback = |call !!msrspoolerInit()|

!iconSize = 16

member .shown is BOOLEAN

member .functions is SPLFUNCTIONS

member .isodBar is BOOLEAN

member .desiBar is BOOLEAN

path d

frame .spl1 'SETTING' at 0.5 0.5

BUTTON .A |SET SPOOL | AT X 0.5 Y 1 linklabel CALLBACK '!!


splNumOpt.edit()'

BUTTON .A0 |ADD PIPE | AT X 0.5 Y 2 linklabel CALLBACK |!


THIS.ADDED()|

BUTTON .A01 |UNCLAIM| AT X 10 Y 1.5 linklabel CALLBACK |!


THIS.CLA()|

exit

frame .spl2 'CREATE' at 0.5 4

BUTTON .A1 |NAME | AT X 0.5 Y 1 linklabel CALLBACK |!THIS.NAM()|


TEXT .T1 || AT X 7 Y 1 width 11 is STRING

BUTTON .A2 |ISODEPT | AT X 0.5 Y 2 linklabel CALLBACK |!


THIS.CREIS()|

BUTTON .A3 |ISOREGI | AT X 0.5 Y 3 linklabel CALLBACK |!


THIS.CREREG()|

BUTTON .A4 |SPLDRG | AT X .5 Y 4 linklabel CALLBACK |!THIS.CRESPL()|

BUTTON .C1 || AT X 7 Y 4 WIDTH 1 CALLBACK |!THIS.COL1()|


BACKG RED

BUTTON .C2 || AT X 9 Y 4 WIDTH 1 CALLBACK |!THIS.COL2()|


BACKG GREEN

BUTTON .C3 || AT X 11 Y 4 WIDTH 1 CALLBACK |!THIS.COL3()|


BACKG BLUE

BUTTON .C4 || AT X 13 Y 4 WIDTH 1 CALLBACK |!THIS.COL4()|


BACKG YELLOW

BUTTON .C5 || AT X 15 Y 4 WIDTH 1 CALLBACK |!THIS.COL5()|


BACKG MAGENTA

BUTTON .C6 || AT X 17 Y 4 WIDTH 1 CALLBACK |!THIS.COL6()|


BACKG Turquoise

EXIT

frame .spl3 'INSERT' at 0.5 9.5

BUTTON .A5 |FIELD WELD| AT X 0.5 Y 1 linklabel CALLBACK |!THIS.FW()|

BUTTON .A6 |SHOP WELD | AT X 0.5 Y 2 linklabel CALLBACK |!


THIS.SW()|

BUTTON .A7 |DISTANCE | AT X 0.5 Y 3 linklabel CALLBACK |!


THIS.DIS()|

TEXT .T2 || AT X 13.5 Y 3 width 5 is real

BUTTON .A8 |SPL BREAK | AT X 0.5 Y 4 linklabel CALLBACK |!


THIS.SPKBR()|

BUTTON .D |DEL | AT X 13.5 Y 4 CALLBACK |!THIS.DEL()| BACKG WHEAT

BUTTON .S |SHOW| AT X 13.5 Y 2 CALLBACK |!THIS.SHO()| BACKG WHEAT

BUTTON .FB |FORW| AT X 13.5 Y 1 CALLBACK |!THIS.BAFO()| BACKG


WHEAT

EXIT
frame .spl4 'ADD & REM SPL' at 21.5 0.5

text .activeSplDrg AT X0.5 Y1.14 tooltip 'Active Spool Drawing' width 1 is STRING

button .pickNavigate AT X0.5 Y1.15 tooltip 'Navigate Pick Mode' pixmap width $!
iconSize height $!iconSize callback |!this.functions.pick('NAVIGATE')|

button .pickAdd AT X3.5 Y1 tooltip 'Add to Spool Drawing Pick Mode' pixmap width
$!iconSize height $!iconSize callback |!this.functions.pick('ADD')|

button .pickRemove AT X6.5 Y1 tooltip 'Remove From Spool Drawing Pick Mode' pixmap
width $!iconSize height $!iconSize callback |!this.functions.pick('REMOVE')|

button .includeFields toggle AT X9.5 Y1 tooltip 'Include Field Components' pixmap


width $!iconSize height $!iconSize callback '!this.functions.includeFields()'

!!appCntrl.setMainForm()

!!appCntrl.modifyMenus()

!iconSize = 16

!this.functions.mainForm = !this

!!moduleMenus(!this)

!this.activeSplDrg.setEditable(false)

!pickNavPix = !!pml.getPathName('navigate' & !iconSize & '.png')

!this.pickNavigate.addPixmap(!pickNavPix)

!pickAddPix = !!pml.getPathName('spldrgadd' & !iconSize & '.png')

!this.pickAdd.addPixmap(!pickAddPix)

!pickRemovePix = !!pml.getPathName('spldrgremove' & !iconSize & '.png')

!this.pickRemove.addPixmap(!pickRemovePix)

!incFieldsOnPix = !!pml.getPathName('includefieldson' & !iconSize & '.png')

!this.includeFields.addPixmap(!incFieldsOnPix)

EXIT
frame .spl5 'UPDATE & MODI' at 21.5 3.2

button .update AT X1 Y1 tooltip 'Update Current Spool Drawing' pixmap width $!


iconSize height $!iconSize callback '!!splUpdate()'

button .modify AT X5 Y1 tooltip 'Renumber' pixmap width $!iconSize height $!


iconSize callback '!!splRenumber()'

button .gene AT X9 Y1 tooltip 'Generate Weld Attributes' pixmap width $!iconSize


height $!iconSize callback '!this.gener()'

!updatePixmap = !!pml.getPathName('spldrgnumber' & !iconSize & '.png')

!this.update.addPixmap(!updatePixmap)

!modifyPixmap = !!pml.getPathName('modify' & !iconSize & '.png')

!this.modify.addPixmap(!modifyPixmap)

!this.gene.addPixmap(!!pml.getPathName('getwork' & !iconSize & '.png'))

EXIT

frame .spl6 'UTILITY' at 21.5 5.8

BUTTON .A9 |FIND PIPE | AT X 0.5 Y 1 linklabel CALLBACK |!THIS.FPIPE()|

BUTTON .A10 |GOTO PIPE | AT X 0.5 Y 2 linklabel CALLBACK |!THIS.GPIPE()|

BUTTON .A11 |GOTO SPLDRG| AT X 0.5 Y 3 linklabel CALLBACK |!


THIS.GSPLD()|

BUTTON .A12 |SPL VOLUME | AT X 0.5 Y 4 linklabel CALLBACK |!


THIS.SPLVOL()|

BUTTON .A13 |SHOW MAIN | AT X 0.5 Y 5 linklabel CALLBACK |SHOW!!AVEUTL|

BUTTON .A14 |ISO SPOOLER| AT X 0.5 Y 6 linklabel CALLBACK |!this.isospl()|

text.man '' at x8 y7 width 1 is real

text.ba '' at x1 y7 width 3 is real

text.ru '' at x7 y7 width 3 is real

BUTTON .A15 |ISO STANDARD| AT X 0.5 Y 8 linklabel CALLBACK |!this.isomm()|

EXIT
FRAME .FRAME5 'REVISION' AT 0.5 15

OPTION .LIST1 'REV ' AT X0.5 Y1 WIDTH 2

TEXT .L1 'DRN ' AT X0.5 Y2.3 WIDTH 4 is string

TEXT .L2 'CHK ' AT X13.8 Y2.3 WIDTH 4 is string

TEXT .L3 'APP ' AT X25 Y2.3 WIDTH 4 is string

PATH DOWN

OPTION .LIST3 AT X0.5 Y3.5 'DATE ' WIDTH 2

PATH RIGHT

OPTION .LIST4 'MTH ' WIDTH 2

OPTION .LIST5 'YR ' WIDTH 2

OPTION .LIST6 AT X 0.5 Y5 'DESC ' WIDTH 24.5

BUTTON .SETREV |SETREV| AT X19 Y1 CALLBACK |!THIS.SREV()|

EXIT

DEFINE METHOD .msrspooler()

!this.T2.VAL = 0

!RTEXT[1]= '0'

!RTEXT[2]= '1'

!RTEXT[3]= '2'

!RTEXT[4]= '3'

!RTEXT[5]= '4'

!RTEXT[6]= '5'

!DTEXT[1]= 'A'

!DTEXT[2]= 'B'

!DTEXT[3]= 'C'

!DTEXT[4]= 'D'
!DTEXT[5]= 'E'

!DTEXT[6]= 'F'

!this.LIST1.DTEXT = !DTEXT

!this.LIST1.RTEXT = !RTEXT

!DTEXT = ARRAY()

!DTEXT[1]= '01'

!DTEXT[2]= '02'

!DTEXT[3]= '03'

!DTEXT[4]= '04'

!DTEXT[5]= '05'

!DTEXT[6]= '06'

!DTEXT[7]= '07'

!DTEXT[8]= '08'

!DTEXT[9]= '09'

!DTEXT[10]= '10'

!DTEXT[11]= '11'

!DTEXT[12]= '12'

!DTEXT[13]= '13'

!DTEXT[14]= '14'

!DTEXT[15]= '15'

!DTEXT[16]= '16'

!DTEXT[17]= '17'

!DTEXT[18]= '18'

!DTEXT[19]= '19'

!DTEXT[20]= '20'

!DTEXT[21]= '21'

!DTEXT[22]= '22'

!DTEXT[23]= '23'

!DTEXT[24]= '24'
!DTEXT[25]= '25'

!DTEXT[26]= '26'

!DTEXT[27]= '27'

!DTEXT[28]= '28'

!DTEXT[29]= '29'

!DTEXT[30]= '30'

!DTEXT[31]= '31'

!this.LIST3.DTEXT = !DTEXT

!SELECTED3TEXT = !this.LIST3.SELECTION()

!DTEXT = ARRAY()

!DTEXT[1]= '01'

!DTEXT[2]= '02'

!DTEXT[3]= '03'

!DTEXT[4]= '04'

!DTEXT[5]= '05'

!DTEXT[6]= '06'

!DTEXT[7]= '07'

!DTEXT[8]= '08'

!DTEXT[9]= '09'

!DTEXT[10]= '10'

!DTEXT[11]= '11'

!DTEXT[12]= '12'

!this.LIST4.DTEXT = !DTEXT

!SELECTED4TEXT = !this.LIST4.SELECTION()

!DTEXT = ARRAY()

!DTEXT[2]= '17'

!DTEXT[3]= '18'

!DTEXT[4]= '19'
!this.LIST5.DTEXT = !DTEXT

!SELECTED5TEXT = !this.LIST5.SELECTION()

!DTEXT = ARRAY()

!DTEXT[1]= 'APPROVED FOR CONSTRUCTION'

!DTEXT[2]= 'ISSUED FOR CONSTRUCTION'

!DTEXT[3]= 'REVISED AS MARKED'

!this.LIST6.DTEXT = !DTEXT

!SELECTED6TEXT = !this.LIST6.SELECTION()

!this.ba.val = 35

!this.ru.val = 180

ENDMETHOD

DEFINE METHOD .ADDED()

!CETYPE = !!CE.TYPE

IF !CETYPE EQ 'PIPE' THEN

PIPE

ADD CE

AUTO CE

enhance ce colour 5

ELSE

ADD CE

AUTO CE

enhance ce colour 2

ENDIF

ENDMETHOD
DEFINE METHOD .NAM()

VAR !ZON NAMN OF ZONE

!NZON = '$!ZON'+'-'+'ISOD'

!THIS.T1.VAL = '$!NZON'

ENDMETHOD

DEFINE METHOD .CREIS()

!TYPE = TYPE

IF (!TYPE EQ 'ISODEP' OR !TYPE EQ 'WORL')THEN

!ISODEPTNAME = '$!THIS.T1.VAL'

NEW ISODEPT NAME /$!ISODEPTNAME

ELSE

!!ALERT.MESSAGE ('ELEMENT YANG DI PILIH HARUS ISODEPT AYAU WORL PADA SPOOLER
WORLD',0.25,0.1)

ENDIF

ENDMETHOD

DEFINE METHOD .CREREG()

!!ALERT.MESSAGE ('CLICK PIPE YANG AKAN DIJADIKAN SPLDRG',0.25,0.1)

ID @

PIPE

!PIPENAME = NAME

VAR !ZON NAMN OF ZONE

!NZON = '$!ZON'+'-'+'ISOD'

/$!NZON

NEW ISOREGI $!PIPENAME-

ENDMETHOD

DEFINE METHOD .CRESPL()

!ISI = !!ALERT.INPUT('MASUKKAN NO SPLDRG','1')


VAR !SPLNAME NAME OF ISOREG

!NZON = '$!SPLNAME'+'SPL'+'-0'+'$!ISI'

NEW SPLDRG NAME $!NZON

ENDMETHOD

DEFINE METHOD .FW()

VAR !SPEC PSPEC OF PIPE

VAR !SIZE :Size1 OF LSTUBE

NEW WELD

SPREF $!SPEC-FW_$!size

Lstube $!SPEC-P-$!size

Shop FALSE

DPFNAME 'FW'

CONN

DESPARAM 1

MOVE DIST $!THIS.T2.VAL

ENDMETHOD

DEFINE METHOD .SW()

VAR !SPEC PSPEC OF PIPE

VAR !SIZE :Size1 OF LSTUBE

NEW WELD

SPREF $!SPEC-SW-$!size

Lstube $!SPEC-P-$!size

Shop TRUE

DPFNAME 'SW'

CONN

DESPARAM 1
MOVE DIST $!THIS.T2.VAL

ENDMETHOD

DEFINE METHOD .FPIPE()

!ISI = !!ALERT.INPUT('MASUKKAN NAMA PIPE','7364')

var !sel collect ALL (PIPE) WITH (MATCHWILD(NAME,'*$!ISI*') )

IF !SEL.SIZE().EQ( 0 ) THEN

!!ALERT.ERROR( 'Pipe tidak ditemukan' )

RETURN

ENDIF

Var !ptot (arraysize(!sel))

do !q from 1 to $!ptot

$!sel[$!q]

var !name name

$p $!name

enddo

ENDMETHOD

DEFINE METHOD .GPIPE()

!CETYPE = DBTYPE

IF (!CETYPE EQ 'ISOD') THEN

!ISORE = NAMN OF ISOREG

!NA = SUBSTRING('$!ISORE',-2)

/$!NA

ELSE

!!Alert.message ('Tidak ditemukan pipa untuk spool drawing ini !!!')

ENDIF
ENDMETHOD

DEFINE METHOD .GSPLD()

!CETYPE = DBTYPE

IF (!CETYPE EQ 'DESI') THEN

!PIPENAME = NAMN OF PIPE

/$!PIPENAME-

ELSE

!!Alert.message ('Pipa ini belum dibuat spool drawingnya !!!')

ENDIF

ENDMETHOD

DEFINE METHOD .SPLVOL()

!CETYPE = !!CE.TYPE

IF (!CETYPE EQ 'SPOOL') THEN

SHOW!!splShipVol

ELSE

!!Alert.message ('Ini bukan Spool silakan pilih spool !!!')

ENDIF

ENDMETHOD

DEFINE METHOD .DEL()

Var !UserName user

Var !UserName UpCase(|$!UserName|)

!CETYPE = !!CE.TYPE

!JAWAB = !!Alert.Confirm('Apakah anda yakin $!UserName untuk menghapus element


ini?')

IF !JAWAB EQ 'YES' THEN

DELETE $!CETYPE

ELSE

ENDIF

ENDMETHOD

DEFINE METHOD .SHO()

Handle any

Elsehandle none

Endhandle

!CENAM = !!CE.NAME

!VISI = !THIS.S.TAG

IF !VISI.EQ( 'SHOW' ) THEN

!THIS.S.TAG = 'HIDE'

VAR !DPEN COLL ALL(WELD) for ce

!TSIZ = !DPEN.SIZE()

DO !A FROM 1 TO !DPEN.SIZE()

$!DPEN[$!A]

DESPARA 0

ENDDO

ELSEIF !VISI.EQ( 'HIDE' ) THEN

!THIS.S.TAG = 'SHOW'

VAR !DPEN COLL ALL(WELD) for ce

!TSIZ = !DPEN.SIZE()

DO !A FROM 1 TO !DPEN.SIZE()
$!DPEN[$!A]

DESPARA 1

ENDDO

ENDIF

$!CENAM

ENDMETHOD

DEFINE METHOD .DIS()

MOVE DIST $!THIS.T2.VAL

ENDMETHOD

DEFINE METHOD .SPKBR()

!!splSfBreak(|add|)

ENDMETHOD

DEFINE METHOD .gener()

IN BORE

!Tolarray = Object Array()

var !attarray coll all(iweld rweld aweld SPOOL) FOR CE

!Tolarray.Appendarray(!attarray)

!I = 1

do !mem values !Tolarray

!Attaname = name of $!mem

$!mem

!atta = !attarray[!i].dbref()
Handle any

Elsehandle none

endhandle

IF TYPE OF CE EQ 'RWELD' THEN

:WELD_TYP 'FW (BW)'

VAR !BR WBORE OF CE

!BRS = !BR.REPLACE( 'in','"' )

:FIELD_TYP '$!BRS'

:SHOP_TYP '-'

!I = !I + 1

ELSEIF TYPE OF CE EQ 'IWELD' THEN

!CK = !!CE.CKEY

:WELD_TYP 'SW ($!CK)'

VAR !BR WBORE OF CE

!BRS = !BR.REPLACE( 'in','"' )

:FIELD_TYP '-'

:SHOP_TYP '$!BRS'

!I = !I + 1

ELSEIF TYPE OF CE EQ 'SPOOL' THEN

Splprefix 'SPL-'

!I = !I + 1

ENDIF

ENDDO

SPLDRG

ENDMETHOD
DEFINE METHOD .BAFO()

Handle any

Elsehandle none

Endhandle

!CENAM = !!CE.NAME

!VISI = !THIS.FB.TAG

IF !VISI.EQ( 'FORW' ) THEN

!THIS.FB.TAG = 'BACK'

BACK

CONN

ELSEIF !VISI.EQ( 'BACK' ) THEN

!THIS.FB.TAG = 'FORW'

FORW

CONN

ENDIF

$!CENAM

ENDMETHOD

DEFINE METHOD .COL1()

ADD CE

AUTO CE

enhance ce colour 2

ENDMETHOD
DEFINE METHOD .COL2()

ADD CE

AUTO CE

enhance ce colour 5

ENDMETHOD

DEFINE METHOD .COL3()

ADD CE

AUTO CE

enhance ce colour 7

ENDMETHOD

DEFINE METHOD .COL4()

ADD CE

AUTO CE

enhance ce colour 4

ENDMETHOD

DEFINE METHOD .COL5()

ADD CE

AUTO CE

enhance ce colour 16

ENDMETHOD

DEFINE METHOD .COL6()

ADD CE

AUTO CE

enhance ce colour 13

ENDMETHOD
DEFINE METHOD .SREV()

!TYPESPL = TYPE

IF (!TYPESPL EQ 'SPLDRG')THEN

!B1 = !THIS.LIST1.SELECTION( 'DTEXT' )

IF '$!B1' EQ 'A' THEN

!B2 = !THIS.L1.VAL

!B3 = !THIS.L2.VAL

!B4 = !THIS.L3.VAL

!B5 = !THIS.LIST6.SELECTION( 'DTEXT' )

!DA1 = !THIS.LIST3.SELECTION( 'DTEXT' )

!DA2 = !THIS.LIST4.SELECTION( 'DTEXT' )

!DA3 = !THIS.LIST5.SELECTION( 'DTEXT' )

!DA4 = '$!DA1'+'-'+'$!DA2'+'-'+'$!DA3'

:REV0 |$!B1|

:DRAWNREV0 |$!B2|

:CONCKBYREV0 |$!B3|

:CONAPBYREV0 |$!B4|

:DATEREV0 |$!DA4|

:DESCREV0 |$!B5|

ELSEIF '$!B1' EQ 'A' THEN

!B2 = !THIS.L1.VAL

!B3 = !THIS.L2.VAL

!B4 = !THIS.L3.VAL

!B5 = !THIS.LIST6.SELECTION( 'DTEXT' )

!DA1 = !THIS.LIST3.SELECTION( 'DTEXT' )


!DA2 = !THIS.LIST4.SELECTION( 'DTEXT' )

!DA3 = !THIS.LIST5.SELECTION( 'DTEXT' )

!DA4 = '$!DA1'+'-'+'$!DA2'+'-'+'$!DA3'

:REV1 |$!B1|

:DRAWNREV1 |$!B2|

:CONCKBYREV1 |$!B3|

:CONAPBYREV1 |$!B4|

:DATEREV1 |$!DA4|

:DESCREV1 |$!B5|

ENDIF

ELSE

!!ALERT.MESSAGE ('POSISI HARUS DI SPLDRG.',0.25,0.1)

ENDIF

ENDMETHOD

Define method .isospl()

if(!!ce.type EQ 'SPLDRG' or !!ce.type EQ 'BRAN') then

SPLDRG

!CPROJ = CURRENT PROJECT

!PCOD = !CPROJ.CODE()

!this.man.val = 2

!Proj = current project

!IsoPath = |%| & !Proj.evar.replace(|000|,|ISO|) & |%\STD|


!!isdRunIso('STA', TRUE)

DETAIL CE

handle any

endhandle

ELSE

!!Alert.Message('ini Bukan <SPLDRG> bro')

return

endif

endmethod

Define method .isomm()

if(!!ce.type EQ 'PIPE' or !!ce.type EQ 'BRAN') then

PIPE

!CPROJ = CURRENT PROJECT

!PCOD = !CPROJ.CODE()

!this.man.val = 1

!Proj = current project

!IsoPath = |%| & !Proj.evar.replace(|000|,|ISO|) & |%\STD|

!!isdRunIso('STA', TRUE)

DETAIL CE

handle any

endhandle

ELSE

!!Alert.Message('ini Bukan <PIPE> atau <BRANCH> bro')

return

endif

endmethod
DEFINE METHOD .CLA()

Handle any

Elsehandle none

Endhandle

GETWORK

SAVEWORK

UNCLAIM ALL

ENDMETHOD

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy