外观
j2FinToolsExt 扩展参考
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793848944/FIN+5.3.1+j2FinToolsExt 中文整理基于 FIN 5.3.1
导读: @FinExtMeta
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- classes
- Slot Details
- onStart
- copyModbusFile
- finBase64Decode
- finBase64Encode
- finBatchRecordCreator
- finBatchRecordList
- finBatchRecordsFilter
- finConnectorTypes
- finDeleteAlarms
- finDistinctConnRefs
- finExec
- finHisReadBaselineStrPointF
- finMacro
- finPodFiles
- finRecordsSources
- finRefDis
- finRestorePod
- finSuperTagger
- finSyncPoints
- finUnique
- finUniqueConnectors
- finUniqueEquipTypes
- finWriteBin
- finZincTagBatchEdit
- finZincTagBatchList
- findPod
- funcDefs
- getPodVersion
- importModbus
- ioCopyFile
- ioCreateDir
- ioExists
- ioReadFileStr
- ioUnzipPod
- ioWriteFile
- kioskImageImport
- listFile
- loadPodGraphic
- readFileTrio
- readFinToolsCsv
- runJob
概述(中译)
@ExtMeta { 名称="finTools"; 依赖=["finstack"] } @FinExtMeta { png图标=fan://j2FinToolsExt/res/img/icon24.png } const class FinToolsExt : Ext
FinTools 扩展
方法
插槽详情
虚拟重写 Void onStart()
const class FinToolsLib : Obj
FIN 堆栈库函数。
方法
API 正文(英文)
| ioUnzipPod | | | ioWriteFile | | | kioskImageImport | | | listFile | | | loadPodGraphic | | | readFileTrio | | | readFinToolsCsv | Read a csv from the pod | | runJob | |
Slot Details
copyModbusFile
@Axon static Void copyModbusFile(Ref recId, Str path)
finBase64Decode
@Axon static Str? finBase64Decode(Str inp, Bool checked := true)
Base64 decoding function Turns a base64 encoded string into a string.
finBase64Encode
@Axon static Str finBase64Encode(Str inp)
Base64 encoding function Turns a string into a base64 encoded string
finBatchRecordCreator
@Axon static Grid finBatchRecordCreator(Obj parentRec, Str recordType, Str[] objectNames, Str[]? src)
finBatchRecordList
@Axon static Grid? finBatchRecordList(Str recordType, Str[]? src)
finBatchRecordsFilter
@Axon static Grid finBatchRecordsFilter(Str type, Str? filter, Str[]? src)
finConnectorTypes
@Axon static Grid finConnectorTypes()
Read connector types
finDeleteAlarms
@Axon static Bool finDeleteAlarms(Obj dates)
Ack/Delete Alarms within the datespan
finDistinctConnRefs
@Axon static Grid finDistinctConnRefs(Str filter)
Read all the distinct conn ref connectors
finExec
@Axon { meta=... } static Grid finExec(Obj? src := null, Obj? globals := null, Bool returnUpdated := false)
This will parse trio file into records then look for "function" tag in each record, then it will execute the function tag expression on the corresponding record. It is sinmilar to funcTemplate
Example function tag:
function: sampleFunc($this, $vendorName)
function: bacnetWriteProperty($connector,$object,$value)Notice, the $ notation, those are auto-bind vars, $this is a special var that points to the current trio record, $vendorName binds to the current trio record's vendorName tag.
1st parameter is a Uri or a Dict[]. it can be null to use default value 2nd parameter is a Dict for vars' values look-up 3rd parameter updateFile set to true to write all updated records back to original trio file
Example:
finExec(<io/propertiesExec.trio>,{connector:@connectorId},false) finExec(<io/propertiesExec.trio>,null,true)
finHisReadBaselineStrPointF
@Axon static Grid finHisReadBaselineStrPointF(Grid curPointHis, Str pointName, Bool isBool := false)
Fantomized version of the finHisReadBaselineStrPoint function
finMacro
@Axon { meta=... } static Obj? finMacro(Obj scope, Str pattern)
Process macro pattern with given scope of variable name/value pairs. The pattern is a Unicode string with embedded expressions:
$tag: resolve tag name from scope, variable name ends with first non-tag, see Etc.isTagName ${tag}: resolve tag name from scope $pod::key: localization key
Any variables which cannot be resolved in the scope are returned as-is (such $name) in the result string.
If a tag resolves to Ref, then we use Ref.dis for string. Example:
readAll(site).finMacro("\\\$dis : \\\$id")finPodFiles
@Axon static List finPodFiles(Str name)
finRecordsSources
@Axon static Grid finRecordsSources(Str recordType)
finRefDis
@Axon static Str finRefDis(Ref? ref)
Get the dis of a ref
finRestorePod
@Axon { meta=["construct":"finRestorePod("fooExt")"] } static Void finRestorePod(Str pod)
finSuperTagger
@Axon { meta=... } static Void finSuperTagger(Str filter, Str column, List matchList)
finSuperTagger
finSyncPoints
@Axon static Void finSyncPoints(List connIds, Number fromOrd, Number toOrd)
ToDo: Move this to migration script
finUnique
@Axon static Grid? finUnique(Grid? g, List? colNames)
finUniqueConnectors
@Axon static Grid finUniqueConnectors(Str filter, Str connType)
Find all the unique connectors of the given type, among the recs which match the given filter
finUniqueEquipTypes
@Axon static Grid finUniqueEquipTypes(Str filter, Number percentMatch, Bool applyTags := false, Str tag := "navName")
Find the uniqe types for the equips
finWriteBin
@Axon static Void finWriteBin(Dict rec, Str tag, Buf buf)
finZincTagBatchEdit
@Axon static Obj finZincTagBatchEdit(Obj recs, Str tagName, Dict? oldRow, Dict? newRow)
Given a list of recs and a tag name such as "schedule" which stores an Zinc encoded grid, apply a change to the row identified by the given tags. If oldRow is null, then add to end. If newRow is null, then remove the row.
finZincTagBatchList
@Axon static Grid finZincTagBatchList(Obj recs, Str tagName)
Given a list of recs and a tag name such as "schedule" which stores an Zinc encoded grid return a list of the unique dicts rows in the zinc tag values. We automatically add a usedBy column with a comma separated list of Refs which contain the dict.
findPod
@Axon static Bool findPod(Str name)
funcDefs
@Axon static Grid? funcDefs()
getPodVersion
@Axon static Str getPodVersion(Str pod)
importModbus
@Axon static Void importModbus(Str uri, Str regMapUri, Str conDis, Number slave, Str siteName, Str floorName, Str? tenantName, Dict? tagObj, Str? folderPath)
ioCopyFile
@Axon static Void ioCopyFile(Obj? fromPath, Uri toPath)
ioCreateDir
@Axon static Void ioCreateDir(Uri toPath)
ioExists
@Axon static Bool ioExists(Obj? path)
ioReadFileStr
@Axon static Str ioReadFileStr(Uri path)
ioUnzipPod
@Axon static Void ioUnzipPod(Str pod, Uri toPath)
ioWriteFile
@Axon static Void ioWriteFile(IOHandle handle, Uri toPath)
kioskImageImport
@Axon static Void kioskImageImport()
listFile
@Axon static Str:Str?[] listFile(Str? root)
loadPodGraphic
@Axon static Ref? loadPodGraphic(Uri path)
readFileTrio
@Axon static Dict[] readFileTrio(Obj? path)
readFinToolsCsv
@Axon static Grid readFinToolsCsv(Uri uri)
Read a csv from the pod
runJob
@Axon static Str runJob(Str exp)