外观
finStackCoreExt 扩展参考
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793783416/FIN+5.3.1+finStackCoreExt 中文整理基于 FIN 5.3.1
导读: - rec: 指记录或装备记录
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- classes
- Slot Details
- backupRecords
- fixImportedRefs
- restoreRecords
- make
- writeJson
- writeJsonToStr
- cur
- onNavMetaChange
- onStart
- updateUiMeta
- addNavURI
- executeMacro
- fin5RefAssets
- finActionsOn
- finAddShadowPoints
- finBackupRecord
- finCheckForUpdate
- finContentOn
- finContext
- finFileToSnapshot
- finFindDuplicateIdsInBackup
- finGenScram
- finGetAllPodDocs
- finGetAllPodNames
- finGetFinDocsForPodWithName
- finGraphicOn
- finGridFilter
- finHisRead
- finImportGrid
- finMigrateFilterIds
- finNavChildren
- finOMFiles
- finParseModBus32
- finPointConn
- finProgramOn
- finReadBinTag
- finReadById
- finReadByIds
- finReadGraphicPoints
- finReadPoints
- finRestoreFile
- finRestoreRecord
- finSetSuperUserPassword
- finShadowPointToPoint
- finSkySparkApps
- finSkySparkViewsForApp
- finSummaryOn
- finTasks
- finTuningPolicies
- finUpdate
- finUpdateLicense
- finWriteBinTag
- firstRun
- firstRunComplete
- fromJSON
- getNavURI
- gridToZinc
- migrateGetFileUrl
- migrateOldId
- migrateRef
- toJSON
概述(中译)
类 BackupRestore : Obj
方法
插槽详情
静态 Grid backupRecords(对象 recs, 字典 ops := ..., 字符串 primaryTag := "equip")
备份所有引用 recs 参数的相关记录。recs 可以是单个 ID 或 ID 列表。默认情况下,这将是一个装备,但用户可以传递任何记录并指定定义该记录实体的 primaryTag。
API 正文(英文)
Params:
rec: ref to or equip record
options: a optional dict that lists the export types, i.e {references, graphics, actions, connectors, programs, omManuals, summaries, tuningPolicies, applyToAll, progressStart:0, progressEnd:100} Users can use {all} to use all options, or {everything} that maps to
primaryTag: an optional string, defaults to
equipbut can be customized by the user by default the functions tries to find this based on the theequipPathtags
Returns:
A Grid with the newly created baccup file record
fixImportedRefs
static Grid fixImportedRefs(Dict[] imported, Bool keepOrig := false, Bool returnImp := false)
restoreRecords
static Grid restoreRecords(Obj? file, Dict ops := ..., Bool keepIds := false, Obj? parent := null)
FINJsonOutStream
class FINJsonOutStream : OutStream
Constructors
| make | Construct by wrapping given output stream. |
Methods
| writeJson | Write the given object as JSON to this stream. |
| writeJsonToStr | Convenience for writeJson to an in-memory string. |
Slot Details
make
new make(OutStream out, Bool complexPrimitives := false)
Construct by wrapping given output stream.
writeJson
This writeJson(Obj? obj)
Write the given object as JSON to this stream. The obj must be one of the follow:
- null
- Bool
- Num
- Str
- Str:Obj?
- Obj?[]
- simple (written as JSON string)
- serializable (written as JSON object)
writeJsonToStr
static Str writeJsonToStr(Obj? obj, Bool complexPrimitives := false)
Convenience for writeJson to an in-memory string.
FinStackCoreExt
@ExtMeta { name="finStackCore" } @FinExtMeta { pngIcon=`fan://finStackExt/res/img/fins_24.png` } const class FinStackCoreExt : Ext
Methods
| cur | |
| onNavMetaChange | |
| onStart | |
| updateUiMeta |
Slot Details
cur
static FinStackCoreExt? cur(Bool checked := true)
onNavMetaChange
Void onNavMetaChange(Dict event)
onStart
virtual override Void onStart()
updateUiMeta
Void updateUiMeta(Str equipPath)
FinStackCoreLib
const class FinStackCoreLib : Obj
Methods
| addNavURI | |
| executeMacro | |
| fin5RefAssets | |
| finActionsOn | Get all Actions which are registered on the given target. |
| finAddShadowPoints | |
| finBackupRecord | Export all the related records referencing the recs parameter The recs can be a single id or a list of ids By default this will be an equip, but users can pass any record and specify the primaryTag that defines the entity for this record. |
| finCheckForUpdate | |
| finContentOn | Get all O&M Manuals which are registered on the given target. |
| finContext | |
| finFileToSnapshot | |
| finFindDuplicateIdsInBackup | Looks inside a file for clashing IDs and returns a list duplicates |
| finGenScram | |
| finGetAllPodDocs | |
| finGetAllPodNames | |
| finGetFinDocsForPodWithName | |
| finGraphicOn | Get all Fin graphics which are registered on the given target. |
| finGridFilter | Filters a grid using a filter expression. |
| finHisRead | |
| finImportGrid | Imports the grid in the local server. |
| finMigrateFilterIds | |
| finNavChildren | |
| finOMFiles | |
| finParseModBus32 | |
| finPointConn | |
| finProgramOn | Get all Programs which are registered on the given target. |
| finReadBinTag | FIN Read Binary Tag |
| finReadById | |
| finReadByIds | |
| finReadGraphicPoints | |
| finReadPoints | |
| finRestoreFile | Restores a FinStack template file |
| finRestoreRecord | Import equip from a zip backup stored on the record Params |
| finSetSuperUserPassword | |
| finShadowPointToPoint | |
| finSkySparkApps | Returns all SkySpark Apps |
| finSkySparkViewsForApp | Returns all Views for a SkySpark app name |
| finSummaryOn | Get all Summaries which are registered on the given target. |
| finTasks | |
| finTuningPolicies | Get all tuning policies which are registered on the given target. |
| finUpdate | |
| finUpdateLicense | |
| finWriteBinTag | FIN Write Binary Tag |
| firstRun | |
| firstRunComplete | |
| fromJSON | |
| getNavURI | |
| gridToZinc | |
| migrateGetFileUrl | Allows you to change the project name on a getFinFile url |
| migrateOldId | |
| migrateRef | Allows you to change the project name on an absolute or relative reference |
| toJSON |
Slot Details
addNavURI
@Axon static Grid addNavURI(Grid list)
executeMacro
static Str executeMacro(Str value, Dict target)
fin5RefAssets
static List fin5RefAssets(Obj file, Str:Obj refMap)
finActionsOn
@Axon static Grid finActionsOn(Obj? target)
Get all Actions which are registered on the given target. The target may be any value accepted by toRec().
finAddShadowPoints
@Axon static Grid finAddShadowPoints(Grid source, Dict? options := null)
finBackupRecord
@Axon static Grid finBackupRecord(Obj recs, Dict ops := ..., Str primaryTag := "equip")
Export all the related records referencing the recs parameter The recs can be a single id or a list of ids By default this will be an equip, but users can pass any record and specify the primaryTag that defines the entity for this record. Params are:
rec: ref or record to an equip
options: a optional dict that lists the export types, i.e {references, graphics, actions, connectors, programs, applyToAll, progressStart:0, progressEnd:100} Users can use {all} to use all options, or {everything} that maps to
primaryTag: an optional string, defaults to
equipbut can be customizale by the user by default the functions tries to find this based on the the equipPath tags
finCheckForUpdate
@Axon static Dict finCheckForUpdate()
finContentOn
@Axon static Grid finContentOn(Obj? target)
Get all O&M Manuals which are registered on the given target. The target may be any value accepted by toRec().
finContext
@Axon static Dict finContext()
finFileToSnapshot
@Axon static Bool finFileToSnapshot(Obj fileRef)
finFindDuplicateIdsInBackup
@Axon static Grid finFindDuplicateIdsInBackup(Obj backup, Dict ops := Etc.makeDict(["relTo":"/"]))
Looks inside a file for clashing IDs and returns a list duplicates
finGenScram
@Axon static Dict finGenScram()
finGetAllPodDocs
@Axon static Grid finGetAllPodDocs()
finGetAllPodNames
@Axon static Grid finGetAllPodNames()
finGetFinDocsForPodWithName
@Axon static Str finGetFinDocsForPodWithName(Str podName)
finGraphicOn
@Axon static Grid finGraphicOn(Obj? target, Bool queryRelated := false)
Get all Fin graphics which are registered on the given target. The target may be any value accepted by toRec().
finGridFilter
@Axon static Grid? finGridFilter(Expr target, Expr filterExpr)
Filters a grid using a filter expression.
Parameters
- target: A grid to be filtered.
- filterExpr: An Axon filter expression.
Returns
- A grid containing elements that match the filterExpr.
Example
readAll(equip).finGridFilter(ahuRef and boilerRef)
finHisRead
@Axon static Grid finHisRead(Obj? hisRefs, Obj? dates, Dict? opts := null)
finImportGrid
@Axon static Grid finImportGrid(Grid grid, Bool newIds := true, Map oldNewIDMap := [:], Obj? parent := null, Bool includeOptionalNavMeta := false)
Imports the grid in the local server. The grid is pre-processed so that it is conforming with the local navMeta. While importing all the missing required nav paths are created as mock entries
finMigrateFilterIds
@Axon static Grid finMigrateFilterIds(Str filter := "id")
finNavChildren
@Axon static Grid finNavChildren(Str treeName, Ref? baseRef := null, Obj? opts := null, Bool filterSubEquipment := false, Bool checkTaskAndVars := false)
finOMFiles
static List finOMFiles(Obj omManualFiles)
finParseModBus32
@Axon static Number finParseModBus32(Number value)
finPointConn
@Axon static Grid finPointConn(Grid grid)
finProgramOn
@Axon static Grid finProgramOn(Obj? target)
Get all Programs which are registered on the given target. The target may be any value accepted by toRec().
finReadBinTag
@Axon static Obj? finReadBinTag(Obj recId, Str tagName)
FIN Read Binary Tag
This function will read the data in the given tag on the given record
this function will return a Str if the tag has text data and will return a handle for all other types
finReadById
@Axon static Dict? finReadById(Ref recId)
finReadByIds
@Axon static Dict[] finReadByIds(Ref[] ids)
finReadGraphicPoints
@Axon static Grid[] finReadGraphicPoints(Str[] pointFilters, Str[] queries, Bool filterIsNavName := false, Ref? targetRef := null, Bool resolveRequestBinding := false, Str treeName := "equip")
finReadPoints
@Axon static Grid finReadPoints(Str[] filters, Bool filterIsNavName := false, Ref? targetId := null, Bool resolveRequestBinding := false, Bool resolveShadowPoints := true, Str treeName := "equip")
finRestoreFile
@Axon static Grid finRestoreFile(Obj? file, Dict ops := ..., Bool keepIds := false, Obj? parent := null)
Restores a FinStack template file
finRestoreRecord
@Axon static Grid finRestoreRecord(Obj rec, Dict ops := ..., Bool keepIds := false, Obj? parent := null)
Import equip from a zip backup stored on the record Params:
- rec: the record that stores a
fileBin tag that contains the actual backup - keepIds: true if the restored records should keep the original back up ids
finSetSuperUserPassword
@Axon static Bool finSetSuperUserPassword(Str oldPassword, Str newPassword)
finShadowPointToPoint
@Axon static Obj? finShadowPointToPoint(Obj shadowRef, Bool refOnly := false)
finSkySparkApps
@Axon static Dict[] finSkySparkApps()
Returns all SkySpark Apps
finSkySparkViewsForApp
@Axon static Dict[] finSkySparkViewsForApp(Str appName)
Returns all Views for a SkySpark app name
finSummaryOn
@Axon static Grid finSummaryOn(Obj? target)
Get all Summaries which are registered on the given target. The target may be any value accepted by toRec().
finTasks
@Axon static Grid? finTasks(Obj? programRef := null, Obj? targetRef := null)
finTuningPolicies
@Axon static Grid finTuningPolicies(Obj? targets)
Get all tuning policies which are registered on the given target. The target may be any value accepted by toRec().
finUpdate
@Axon static Bool finUpdate(Obj? fileId := null)
finUpdateLicense
@Axon static Bool finUpdateLicense(Obj fileRef)
finWriteBinTag
@Axon static Dict? finWriteBinTag(Obj recId, Str tagName, Obj handle, Str mimeType := "text/plain")
FIN Write Binary Tag
This function writes the data described by the handle to the given bin tag on the requested record.
firstRun
@Axon static Grid firstRun()
firstRunComplete
@Axon static Bool firstRunComplete()
fromJSON
@Axon static Obj? fromJSON(Str value)
getNavURI
@Axon static Obj? getNavURI(Obj recId, Str treeName := "equip")
gridToZinc
@Axon static Str gridToZinc(Grid grid)
migrateGetFileUrl
@Axon static Str migrateGetFileUrl(Str original, Str projectName)
Allows you to change the project name on a getFinFile url
/getFinFile/projectA -> /getfinFile/projectB
@param original Original getFinFile URL @param projectName New project name to point the url to @return getFinFile URL that queries the project specified by the projectName
migrateOldId
static Str migrateOldId(Str original, Str projName)
migrateRef
@Axon static Ref migrateRef(Ref original, Str projectName)
Allows you to change the project name on an absolute or relative reference
@p:projectA:r:1234-5678 -> @p:projectB:r:1234-5678 or @1234-5678 -> @p:projectB:r:1234-5678
@param original Original Reference @param projectName New project name to point the reference to @return reference that points to the project specified by the projectName
toJSON
@Axon static Str toJSON(Obj? item, Bool complexNumbers := false)