AVEVA PDMS PML 二次开发之模糊查找工具

简介: AVEVA PDMS PML 二次开发之模糊查找工具FuzzySearch 在AVEVA Plant(PDMS)/AVEVA Marine中,要查找一个不是很清楚的元素可能有些不便,使用PML开发了一个模糊查找的小工具,如下图所示: 使用方法: 1.

AVEVA PDMS PML 二次开发之模糊查找工具FuzzySearch

在AVEVA Plant(PDMS)/AVEVA Marine中,要查找一个不是很清楚的元素可能有些不便,使用PML开发了一个模糊查找的小工具,如下图所示:

Main GUI

使用方法:

1. 在key word中输入需要查找的部件的名字或名字的一部分;

2. 也可输入通配符,如*表示求知的任意几个字符, ?表示求知的一个字符;

3. 查找到的元素将会在列表中显示出来,在列表中选择,将会在模型中定位到选择的元素;

 


2012.12.6
看很多人比较喜欢这个工具,将其源代码陈列如下:

  1 -------------------------------------------------------------------------------
  2 -- Copyright (C) 2010 eryar@163.com All Rights Reserved.
  3 --
  4 -- File:            FuzzySearch.pmlfrm
  5 --   Type:          Form Definition
  6 --   Group:         Application
  7 --     Keyword:     MDS
  8 --   Module:        DESIGN
  9 --
 10 -- Author:          eryar@163.com
 11 -- Created:         2012-8-15 19:22
 12 --
 13 -- Description:     Fuzzy search element.
 14 --
 15 -------------------------------------------------------------------------------
 16 setup form !!fuzzysearch
 17     !this.formtitle     =  ' Fuzzy Search '
 18     !this.cancelCall    =  ' !this.OnCancel() '
 19     !this.formRevision  =  ' 0.1v '
 20 
 21     frame .fuzzySearchFrame
 22         text    .tKeyWord    ' Key Word: ' width 18  is string
 23         button  .bGo         ' Go '    callback     ' !this.OnOk() '
 24         button  .bHelp       ' ? '     callback     ' !this.OnHelp() '
 25         list    .lResult    at xmin.tKeyWord ymax+0.2    width 36 height 16
 26     exit
 27 
 28     path down
 29 
 30     button  .bCancel     ' Cancel '    callback     ' !this.OnCancel() '
 31 
 32 exit
 33 -------------------------------------------------------------------------------
 34 --
 35 -- Method:      fuzzySearch()
 36 --
 37 -- Description: default constructor.
 38 --
 39 -- Method Type: Function/Procedure
 40 -- Arguments:
 41 --   [ # ] [R/RW] [Data Type] [Description]
 42  -- Return:
 43 --   [Data Type] [Description]
 44 --
 45 -------------------------------------------------------------------------------
 46 define method .fuzzysearch()
 47     !this.lResult.callback  =    ' !this.zoomSelection() '
 48 endmethod
 49 -------------------------------------------------------------------------------
 50 --
 51 -- Method:      apply()
 52 --
 53 -- Description: apply the operation.
 54 --
 55 -- Method Type: Function/Procedure
 56 -- Arguments:
 57 --   [ # ] [R/RW] [Data Type] [Description]
 58  -- Return:
 59 --   [Data Type] [Description]
 60 --
 61 -------------------------------------------------------------------------------
 62 define method .OnOk()
 63     -- 1. Check the input name;
 64      if(!this.tKeyWord.val.Empty()) then
 65         !!alert.message( ' Please input the key word! ')
 66          return 
 67     endif
 68 
 69     -- 2. Collect all elements  for the whole world;
 70     var !allElements collect all  for world
 71 
 72     -- 3. Search the element include the keyword;
 73     -- If include the keyword, add the element to
 74     -- the result list.
 75     !dtext  = array()
 76     !rtext  = array()
 77     !strName= string()
 78     !strKeyWord = !this.tKeyword.val
 79 
 80     do !element values !allElements
 81         -- 
 82         !current    = object dbref(!element)
 83         !strName    = !current.namn
 84         
 85          if(!strName.MatchWild(!strKeyWord)) then
 86             !dtext.append(!strName)
 87             !rtext.append(!element)
 88         endif
 89         
 90     enddo
 91 
 92     -- 4. Add to the result list.
 93     !this.lResult.dtext = !dtext
 94     !this.lResult.rtext = !rtext
 95 
 96 endmethod
 97 -------------------------------------------------------------------------------
 98 --
 99 -- Method:      ZoomSelection()
100 --
101 -- Description: Zoom to the selected element.
102 --
103 -- Method Type: Function/Procedure
104 -- Arguments:
105 --   [ # ] [R/RW] [Data Type] [Description]
106  -- Return:
107 --   [Data Type] [Description]
108 --
109 -------------------------------------------------------------------------------
110 define method .ZoomSelection()
111     !selection  = !this.lResult.Selection()
112     !selected   = object dbref(!selection)
113     
114     -- Zoom to selection.
115     add $!selected
116     auto $!selected
117 
118 endmethod
119 -------------------------------------------------------------------------------
120 --
121 -- Method:      OnCancel()
122 --
123 -- Description: 
124 --
125 -- Method Type: Function/Procedure
126 -- Arguments:
127 --   [ # ] [R/RW] [Data Type] [Description]
128  -- Return:
129 --   [Data Type] [Description]
130 --
131 -------------------------------------------------------------------------------
132 define method .OnCancel()
133     !this.hide()
134 endmethod
135 -------------------------------------------------------------------------------
136 --
137 -- Method:      OnHelp()
138 --
139 -- Description: Show how to use information.
140 --
141 -- Method Type: Function/Procedure
142 -- Arguments:
143 --   [ # ] [R/RW] [Data Type] [Description]
144  -- Return:
145 --   [Data Type] [Description]
146 --
147 -------------------------------------------------------------------------------
148 define method .OnHelp()
149     !!alert.message( ' In the KeyWord * for any number of characters and ? for any single chararcter. ')
150 endmethod
151 -------------------------------------------------------------------------------
目录
相关文章
|
C# C++ Windows
PDMS call Operating System Command
PDMS call Operating System Command eryar@163.com 1.Introduction AVEVA提供了三种二次开发的方式:DARs, PML和AVEVA .Net(C#)。
2598 0
|
弹性计算 关系型数据库 数据库
PostgreSQL 数据库实例只读锁定(readonly) - 硬锁定,软锁定,解锁
标签 PostgreSQL , 只读 , 锁定 , readonly , recovery.conf , 恢复模式 , pg_is_in_revoery , default_transaction_read_only 背景 在一些场景中,可能要将数据库设置为只读模式。 例如, 1、云数据库,当使用的容量超过了购买的限制时。切换到只读(锁定)模式,确保用户不会用超。 2、业务上需要对
8185 0
|
数据库 项目管理 安全
AVEVA Plant(PDMS)数据库的保护
AVEVA Plant(PDMS)数据库的保护 eryar@163.com   以下内容摘自一网友邮件: ----- Original Message ----- Sent: Tuesday, September 25, 2012 9:46 PM Subject: PDMS项目管理 你好,看了你写的很多文章,大部分都是关于程序出图的设置,我想咨询你一个关于PDMS项目管理的问题,希望能够赐教。
2599 0
|
网络协议 数据处理 C++
LabVIEW与Simulink的通信及调用方式
LabVIEW与Simulink的通信及调用方式
666 1
|
前端开发
layui-form
`layui-form`是一个前端表单组件,提供多种表单类型如单行、多行排列的输入框,下拉选择框(支持模糊搜索),单选框和复选框。表单元素可通过`required`和`lay-verify`属性进行必填和验证设置。编辑器如`layedit`可用于富文本输入,表单监听事件如提交和单选器可绑定回调函数进行处理。此外,能动态更新渲染表单,初始化表单数据并进行数据校验,包括自定义验证规则。
1046 1
|
负载均衡 Cloud Native 安全
猫头虎解析:如何巧妙避免GET请求中的“EOF“错误?
猫头虎解析:如何巧妙避免GET请求中的“EOF“错误?
1206 0
|
算法 异构计算
m基于FPGA的cordic算法实现,输出sin和cos波形
m基于FPGA的cordic算法实现,输出sin和cos波形
677 0
m基于FPGA的cordic算法实现,输出sin和cos波形
|
存储 编解码 人工智能
ps2023最新和谐版Photoshop23免费绿色版本下载
ps2023版是Adobe公司发布的最新版本的Photoshop,增强改进了不少了的功能,结合了最新的AI技术,修复老照片效果极强,改善了选择功能,品质得到了极大的提升,支持无缝协作,本站为大家提供ps2023直装版下载,安装后就是破解版本了,不需要再额外使用破解补丁或者序列号了,完全能免费的使用Photoshop。PS2023下载链接:https://pan.baidu.com/s/12QQve9Ozl7chXOMw8zB4pw?pwd=lv78 提取码:lv78
3819 0
|
C# 数据库 C++
AVEVA PDMS数据接口开发
AVEVA PDMS数据接口的开发 eryar@163.com          摘要:本文简要介绍AVEVA Plant/PDMS数据接口的开发方式。        关键字:AVEVA Plant、PDMS、DARs、二次开发、数据接口   一、概述 Overview AVEVA提供了三种二次开发的方式:DAR(Data Access Routines)、C#、PML(AVEVA Programmable Macro Language)。
3844 0
|
数据库 C# 数据格式
AVEVA .NET Quick Start Guide
AVEVA .NET Quick Start Guide AVEVA .NET快速入门引导 eryar@163.com 一、概述 Introduction AVEVA提供.Net的二次开发接口,可使有C#编程经验的软件工程师使用Visual Studio来对AVEVA的工厂(Plant)设计和船舶(Marine)设计产品进行二次开发。
5445 0