• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            eryar

            PipeCAD - Plant Piping Design Software.
            RvmTranslator - Translate AVEVA RVM to OBJ, glTF, etc.
            posts - 603, comments - 590, trackbacks - 0, articles - 0

            PDMS PML二次開發-Pipe Flow Indicator

            Posted on 2012-05-20 20:18 eryar 閱讀(3174) 評論(0)  編輯 收藏 引用 所屬分類: 4.AVEVA Solution

            PDMS PML二次開發-Pipe Flow Indicator


            AVEVA PDMS中管路流向顯示程序:

            pipe flow

             

            PML程序源代碼如下:

            ---------------------------------------------------------------------------------
            --
            -- (c) Copyright 2010 to Current Year 
            -- Shanghai Hoto Petrochemical Engineering Co., Ltd
            -- eryar All rights reserved.
            --
            --  File:          pipeflow.pmlfrm
            --  Type:          Form Definition
            --  Group:         General Application
            --  Keyword:       GEN
            --  Module:        DESIGN
            --
            -- Author:          eryar@163.com
            -- Created:         2010-09-17 15:15
            --
            -- Description:     Indicate pipe media flow direction.
            --
            ---------------------------------------------------------------------------------
            setup form 
            !!pipeflow
                    
            !This.FormTitle         =       'Pipe Flow Indicator'
                    
            !This.Cancelcall        =       '!This.close()'
                    
            !This.FormRevision      =       '1.0v'
             
                    frame .pipeFlowFrame
                            button  .bCE    
            'CE'   
                            para    .ceName                 at      xmax            ymin    width 
            16 line 1
             
                            toggle  .turn   
            'On/Off'        at      xmax            ymin                    
                    exit
                            
            exit
             
            ---------------------------------------------------------------------------------
            --
            -- Method:      pipeflow()
            --
            -- Description:  
            --
            -- Method Type: Function/Procedure
            -- Arguments:
            --   [#] [R/RW] [Data Type] [Description]
            -- Return:
            --   [Data Type] [Description]
            --
            ---------------------------------------------------------------------------------
            define method .pipeflow()
                    
            !this.bCE.callback      =       '!this.getCE()'
                    
            !this.turn.callback     =       '!this.apply()'
            endmethod
            ---------------------------------------------------------------------------------
            --
            -- Method:      getCE()
            --
            -- Description:  get current element for indicate pipe media flow
            --
            -- Method Type: Function/Procedure
            -- Arguments:
            --   [#] [R/RW] [Data Type] [Description]
            -- Return:
            --   [Data Type] [Description]
            --
            ---------------------------------------------------------------------------------
            define method .getCE()
                    
            --
                    
            !currentElement =       ce
                    
            !elementName    =       !currentElement.Name
                    
            !this.ceName.val=       !elementName
             
            endmethod
            ---------------------------------------------------------------------------------
            --
            -- Method:      apply()
            --
            -- Description:  
            --
            -- Method Type: Function/Procedure
            -- Arguments:
            --   [#] [R/RW] [Data Type] [Description]
            -- Return:
            --   [Data Type] [Description]
            --
            ---------------------------------------------------------------------------------
            define method .apply()
                    
            -- remember where we came in
                    
            !memory =       ce
                    
                    
            -- turn on pipe media flow
                    
            if(!this.turn.val) then
                            
            -- collect all branches 
                            var 
            !branches collect all bran for $!this.ceName.val
                            
                            
            do !i index !branches
                                    
            -- handle every branch
                                    
            !branch =       !branches[$!i].dbref()
                                    
            !hPos   =       !branch.hPosition
                                    
            !tPos   =       !branch.tPosition
                                    
            !hDir   =       !branch.hDirection
                                    
            !tDir   =       !branch.tDirection
                                    
            !hBore  =       !branch.hBore
                                    
            !tDir   =       !tDir.Opposite()
                                    
            !arrow  =       !hBore.real() * 2
             
                                    
            -- add two aid arrow at head and tail
                                    AID ARROW AT $
            !hPos DIR $!hDir HEIGHT $!arrow PROPORTION 0.35
                                    AID ARROW AT $
            !tPos DIR $!tDir HEIGHT $!arrow PROPORTION 0.35
             
                                    
            -- add aid arrow on elbow
                                    var 
            !elbows collect all elbow for $!branch
                                    
            do !j index !elbows
                                            
            !elbow          =       !elbows[$!j].dbref()
                                            
            !arrive         =       !elbow.Arrive
                                            
            !leave          =       !elbow.Leave
                                            $
            !elbow
                                            var 
            !arrivePos  P$!<arrive>     position wrt world
                                            handle (
            2,201)
                                                    
            -- element does not have attribute PPOS
                                                    skip
                                            endhandle
                                            var 
            !leavePos   P$!<leave>      position wrt world
                                            handle (
            2,201)
                                                    
            -- element does not have attribute PPOS
                                                    skip
                                            endhandle
                                            var 
            !arriveDir  P$!<arrive>     direction wrt world
                                            var 
            !leaveDir   P$!<leave>      direction wrt world
                                            
            !arriveDir      =       !arriveDir.Direction().Opposite().string()
                                            
            --
                                            AID ARROW AT $
            !arrivePos DIR $!arriveDir  HEIGHT $!arrow PROPORTION 0.35
                                            AID ARROW AT $
            !leavePos  DIR $!leaveDir   HEIGHT $!arrow PROPORTION 0.35
                                    enddo
             
                                    
            -- add aid arrow on valve
                                    var 
            !valves collect all valve for $!branch
                                    
            do !h index !valves
                                            
            !valve  =       !valves[$!h].dbref()
                                            
            !vPos   =       !valve.Position
                                            
            --
                                            AID ARROW AT $
            !vPos DIR $!arriveDir  HEIGHT $!hBore PROPORTION 0.8
                                    enddo
             
                                    
            -- add aid arrow on tubi
                                    var 
            !tubes collect all tubi for $!branch
                                    
            do !k index !tubes
                                            
            !tube   =       !tubes[$!k].dbref()
                                            
            !itsLen =       !tube.itLength
                                            
            !itsPos =       !tube.itPosition
                                    enddo
                            enddo
                    
            else
                            
            -- turn off pipe media flow, clear all aid arrow
                            AID CLEAR ALL
                    endif
             
                    
            -- go back 
                    
            !!ce    =       !memory
            endmethod
            ---------------------------------------------------------------------------------
            --
            -- Method:      close()
            --
            -- Description:  
            --
            -- Method Type: Function/Procedure
            -- Arguments:
            --   [#] [R/RW] [Data Type] [Description]
            -- Return:
            --   [Data Type] [Description]
            --
            ---------------------------------------------------------------------------------
            define method .close()
                    
            -- after close the form, clear all aid arrow
                    AID CLEAR ALL
            endmethod
            ---------------------------------------------------------------------------------
            99国产精品久久| 亚洲精品乱码久久久久久蜜桃 | 国产高潮国产高潮久久久| 欧美黑人激情性久久| 久久av无码专区亚洲av桃花岛| 久久综合国产乱子伦精品免费| 精品国际久久久久999波多野| 精品午夜久久福利大片| 久久精品国产WWW456C0M| 亚洲午夜精品久久久久久app| 久久人妻少妇嫩草AV无码专区| 老司机国内精品久久久久| 久久人妻少妇嫩草AV无码蜜桃| 中文字幕热久久久久久久| AAA级久久久精品无码区| 一级女性全黄久久生活片免费 | 国产精品久久成人影院| 国内精品久久久久久久久| 精品多毛少妇人妻AV免费久久| 久久久久久免费一区二区三区| 一本久久a久久精品综合香蕉| 97久久久久人妻精品专区 | 久久久免费精品re6| 久久久久无码精品国产app| 国产精品99久久99久久久| 香蕉久久夜色精品国产尤物| 国产精品无码久久综合| 精品国产乱码久久久久软件| 久久99国产一区二区三区| 狠狠色婷婷综合天天久久丁香| 久久午夜夜伦鲁鲁片免费无码影视 | 品成人欧美大片久久国产欧美| 麻豆成人久久精品二区三区免费 | 日韩欧美亚洲国产精品字幕久久久| 国产午夜久久影院| 97热久久免费频精品99| 久久综合国产乱子伦精品免费| 久久亚洲国产成人影院| 色婷婷噜噜久久国产精品12p| 久久精品成人欧美大片| 久久久久国产视频电影|