Skip to content

finStackExt 扩展参考 ​

原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793914464/FIN+5.3.1+finStackExt 中文整理基于 FIN 5.3.1

导读: 本页为 FIN 扩展 finStackExt 的 API 参考文档。

以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。


目录(导读) ​

  • classes
  • Slot Details
    • make
    • receive
    • config
    • connectorName
    • discoveryRecord
    • project
    • sys
    • user
    • EXTS_TO_ENABLE
    • autoEnablePods
    • cur
    • enableExtsAndDependencies
    • errorHandler
    • onPost
    • onPut
    • onStart
    • onSteadyState
    • startFinService
    • finStackBootStrap
    • finTemplateCopy
    • writeFileRec
    • arcs
    • finActionsRewrite
    • finAssetUsedBy
    • finBeginDiscovery
    • finCapsNeeded
    • finConnExts
    • finCopyBoundPoints
    • finCreateHaystackDb
    • finCreateTemplatePackage
    • finCreateTemplatePackage2
    • finCurrentDayInfo
    • finDiscoveryAdd
    • finDiscoverySessionCleanup
    • finDiscoverySessionEnd
    • finDiscoveryStatusCheck
    • finElementOn
    • finElementsOn
    • finEnergyAnnualMonthlyDayRollup
    • finEnergyAnnualMonthlyRollup
    • finEnergyAnnualWkDayRollup
    • finEquipPointTagClone
    • finFileAndAssetDelete
    • finFindRecordByChild
    • finFindRecordByChildDeep
    • finFindRecordByChildInternal
    • finFixOldBinTags
    • finFoldGrid
    • finFuncs
    • finGetCaps
    • finGetConnectorTagSpecs
    • finGetCurrentUser
    • finGetDiscoveryConfiguration
    • finGetHelp
    • finHaystackDrillDown
    • finHaystackExcludedTags
    • finHaystackLearn
    • finHttpProxy
    • finNavDrillDown
    • finNavDuplicate
    • finNavMain
    • finNavMerge
    • finNavMetaTagList
    • finNavNavlets
    • finNavRollup
    • finNavletsOn
    • finNoteSummary
    • finPaginate
    • finParseFilter
    • finPointSummary
    • finPublishTemplatePackage
    • finRebuildDocs
    • finRebuildNavTree
    • finRecordTagClone
    • finRemoveCategory
    • finScheduleCopyDays
    • finShowPointsInWatch
    • finShowWatches
    • finSub
    • finSubEnd
    • finSubStart
    • finSyncTags
    • finUniqueActions
    • finUniqueTags
    • finUriToDict
    • finhaystackDeviceDiscovery
    • finhaystackDeviceDiscoveryConfig
    • finsedonaDeviceDiscovery
    • finsedonaDeviceDiscoveryConfig
    • getItemName
    • getRefTagsHelp
    • mergeTreeElements
    • moveItemIntoTree
    • discover
    • LocaleTable
    • getLanguageName
    • dis
    • filter
    • func
    • id
    • name
    • rec
    • allNavlets
    • cx
    • ext
    • navMain
    • navMainRec
    • navNavlets
    • navletEval
    • navletsOn
    • readNavletsOn
    • toImage
    • toSummary1
    • toSummary2

概述(中译) ​

const class DiscoveryActor : Actor

构造函数

方法

插槽详情

new make(ActorPool p)


API 正文(英文) ​

receive ​

virtual override Obj? receive(Obj? msg)


DiscoveryMsg ​

const class DiscoveryMsg : Obj

Constructors

make

Fields

config
connectorName
discoveryRecord
project
sys
user

Slot Details ​


config ​

const Str? config


connectorName ​

const Str connectorName


discoveryRecord ​

const Dict discoveryRecord


make ​

new make(Sys sys, Proj proj, User user, Str connectorName, Dict discoveryRecord, Str? config := null)


project ​

const Proj project


sys ​

const Sys sys


user ​

const User user


FinStackExt ​

@ExtMeta { name="finstack"; depends=["finStackCore"] } @FinExtMeta { licFeature="finstack"; pngIcon=`fan://finStackExt/res/img/fins_24.png` } const class FinStackExt : FinExt, Weblet

FinStack Extension

Fields

EXTS_TO_ENABLE

Methods

autoEnablePods
curGet FinStackExt for the current context.
enableExtsAndDependencies
errorHandler
onPost
onPutHandle web requests
onStart
onSteadyState
startFinService

Slot Details ​


EXTS_TO_ENABLE ​

const static Str[] EXTS_TO_ENABLE := ...


autoEnablePods ​

Void autoEnablePods()


cur ​

static FinStackExt? cur(Bool checked := true)

Get FinStackExt for the current context.


enableExtsAndDependencies ​

Void enableExtsAndDependencies(Str[] disabledExts)


errorHandler ​

Void errorHandler(Err error)


onPost ​

virtual override Void onPost()


onPut ​

virtual override Void onPut()

Handle web requests


onStart ​

virtual override Void onStart()


onSteadyState ​

virtual override Void onSteadyState()


startFinService ​

Void startFinService()


FinStackInternalLib ​

const class FinStackInternalLib : Obj

Methods

finStackBootStrap
finTemplateCopy
writeFileRec

Slot Details ​


finStackBootStrap ​

static Void finStackBootStrap()


finTemplateCopy ​

static Grid finTemplateCopy(Ref source, Str basePath, Dict[] targets, Bool returnClones := false)


writeFileRec ​

static Grid writeFileRec(Map tags, InStream input, Int size, MimeType? mimeType)


FinStackLib ​

const class FinStackLib : Obj

FIN|Stack library functions.

Methods

arcsGiven a grid of source data, return the arcs and the arc summaries which are available for the source data.
finActionsRewriteRewrite actions that match the filter expression and the oldExprDict, dis and expr, fields with the new newExprDict, that contains new tags or overrides existing dis or expr tags, or removes tags
finAssetUsedByGiven an asset or list of asset records or refs return a grid with fin project records that use those assets
finBeginDiscoveryBegins a Discovery session Returns the id of this discovery session.
finCapsNeededThis function, given the number of required CAPS, returns a grid with the licensing parts and how many parts are needed alog with the base to reach desired CAPS at the lowest price.
finConnExts
finCopyBoundPoints
finCreateHaystackDbTakes a haystack connector ref or a list of haystack connector refs and using the navTree supplied imports the entities matching the navFiltering to the local server
finCreateTemplatePackageCreates a template package to be published to StackHub
finCreateTemplatePackage2
finCurrentDayInfoReturns a grid with the columns
finDiscoveryAddAdd discovered item to system
finDiscoverySessionCleanupDestroy Discovery Session
finDiscoverySessionEndClose Discovery Session
finDiscoveryStatusCheckGet Discovery Status.
finElementOnFIN Element On This method will find records compatible with the target element based off of the elementTag.
finElementsOnFIN Elements On This method will find records compatible with all of the target elements based off of the elementTag.
finEnergyAnnualMonthlyDayRollupGiven a point ID and a folding function (sum, avg, median, etc....) the result of the query will return a years worth of data, and it will create up to 31 columns of data.
finEnergyAnnualMonthlyRollupGiven a point or list of points ID and a folding function (sum, avg, median, etc....), if the points have a history it would return a row for each point, and then have 12 months of columns in it, for the last year, folded using the given function.
finEnergyAnnualWkDayRollupGiven a point ID and a folding function (sum, avg, median, etc....) the result of the query will return a years worth of data, and it will create up to 31 columns of data.
finEquipPointTagClone
finFileAndAssetDeleteGiven a finProject or list of finProject records or refs the function will delete the finProject(s) and assets that are use only by this project.
finFindRecordByChildThis function is just like finFindRecordByChildDeep except this one only searches 1 level deep, and is way more effecient.
finFindRecordByChildDeepThis function will let you search for children of something.
finFindRecordByChildInternal
finFixOldBinTags
finFoldGrid
finFuncsFIN Funcs This method merges the result of the funcs() query with extra data within the finFuncs.trio file to support FIN
finGetCapsThis function returns a grid with the licensing parts and their prices.
finGetConnectorTagSpecsReturns a Grid with the tag specs defined for an enabled connector.
finGetCurrentUser
finGetDiscoveryConfigurationGet Discovery Configuration
finGetHelp
finHaystackDrillDownTakes a connector ref or a list of haystack connector refs and using the navTree supplied queries all the nav paths on each connector and creates an grid with all the entities that match the path.
finHaystackExcludedTagsReturns a grid of tags to be excluded when working with records coming from haystack or nhaystack connectors
finHaystackLearnImproves haystackLearn so that it fetches all the tags defined for a learn path
finHttpProxy
finNavDrillDownGets all the children of the parent id or parent id list that matches the supplied navTree start - a ref or list of refs or a rec or list of records
finNavDuplicateDuplicates a record using the nav tree specified by treeName This functions uses the built-in proj::SysLib.navDuplicate function with the important add-on of also duplication the children of the src record that have the same nav level as the source, i.e.
finNavMain
finNavMerge
finNavMetaTagListGiven an record that is part of the equipPath Posible ops are {"drillDown":false, "values":true, "getRef":true} If drillDown is present: Find all unique tags that are used by the record and all it's nav children.
finNavNavlets
finNavRollup
finNavletsOn
finNoteSummary
finPaginateFIN
finParseFilterDecode a filter expression into a grid of operands
finPointSummaryGenerate a point summary by equip
finPublishTemplatePackageUpload a template package to Stack Hub
finRebuildDocsRebuilds the documentation using the FINStack style
finRebuildNavTreeRebuild a nav tree by ensuring that parent refs to and from the specified navLevel are bound to parents and children respectively An optional parent ref id can be supplied so that the rebuild is limited to the branch starting from that specific parent ref id.
finRecordTagClone
finRemoveCategoryRemoves a category or a list of categories from all actions and user records
finScheduleCopyDaysChange a weekly schedule (or list of weekly schedules) by copying parts of it to other week days
finShowPointsInWatchList all records registered for a watch id
finShowWatchesList all watches open for this project
finStackBootStrap
finSubEvaluate the given expression.
finSubEndLast call of an evalAll for subscription.
finSubStartOpen a new watch as part of an evalAll.
finSyncTagsFIN Synchronize Tags This method will recursively synchronize the tag values from the source onto all of the children down the given tree
finTemplateCopy
finUniqueActionsFind all actions that have the same dis and expr tags Returns a grid with dis, expr, count rows to show how many similar actions were found.
finUniqueTagsfinUniqueTags
finUriToDict
finhaystackDeviceDiscovery
finhaystackDeviceDiscoveryConfig
finsedonaDeviceDiscovery
finsedonaDeviceDiscoveryConfig
getItemName
getRefTagsHelp
mergeTreeElements
moveItemIntoTree

Slot Details ​


arcs ​

@Axon static Grid arcs(Grid src, Obj? dates := null)

Given a grid of source data, return the arcs and the arc summaries which are available for the source data.

Examples:

readAll(site).arcs        // using project default date span
readAll(site).arcs(today) // with explicit data span

finActionsRewrite ​

@Axon { meta=... } static Grid finActionsRewrite(Expr filter, Expr oldExprDict, Expr newExprDict)

Rewrite actions that match the filter expression and the oldExprDict, dis and expr, fields with the new newExprDict, that contains new tags or overrides existing dis or expr tags, or removes tags

Users should call this like:

// all actions that have the dis and expr equal with the oldExprDict will get a new tag someTag finActionsRewrite(actions, {dis:"Manual Auto", expr: "pointAuto($self)"}, {someTag}) // all actions that have the dis and expr equal with the oldExprDict will get the tag someTag removed finActionsRewrite(actions, {dis:"Manual Auto", expr: "pointAuto($self)"}, {-someTag})


finAssetUsedBy ​

@Axon static Grid finAssetUsedBy(Obj? assets)

Given an asset or list of asset records or refs return a grid with fin project records that use those assets


finBeginDiscovery ​

@Axon static Grid finBeginDiscovery(Str connectorName, Str discoveryConfiguration := "")

Begins a Discovery session Returns the id of this discovery session. You can use this id to check real time results using the function finDiscoveryStatusCheck()

Example:

finBeginDiscovery("bacnet", "ver:\"2.0\" \n serialPort,baudRate,broadcastAddress,localAddress,instanceLow,instanceHi,networkNo,discoveryTimeout \n \"\",76800,\"255.255.255.255\",\"0.0.0.0\",0,4194303,65535,8")
finBeginDiscovery("bacnetMstp", "ver:\"2.0\" \n serialPort,baudRate,broadcastAddress,localAddress,instanceLow,instanceHi,networkNo,discoveryTimeout \n \"com1\",76800,\"FF\",\"00\",0,4194303,65535,8")

finCapsNeeded ​

@Axon static Grid finCapsNeeded(Number capCount, Number mult := Number.<ctor>(1), Dict? params := null)

This function, given the number of required CAPS, returns a grid with the licensing parts and how many parts are needed alog with the base to reach desired CAPS at the lowest price.

Has 3 parameters:

  • capCount: number of required CAPS
  • mult: multiplier number (optional)
  • params: a dictionary of parameters (optional)

finConnExts ​

@Axon static Grid finConnExts()


finCopyBoundPoints ​

@Axon static Grid? finCopyBoundPoints(Expr sourceExpr, Expr targetExpr)


finCreateHaystackDb ​

@Axon static Grid finCreateHaystackDb(Obj? conns, Str? startLearn := "sep:/", Bool hisEnable := false, Bool doImport := true, Obj? parent := null, Str? rootLearn := "")

Takes a haystack connector ref or a list of haystack connector refs and using the navTree supplied imports the entities matching the navFiltering to the local server


finCreateTemplatePackage ​

@Axon static Grid finCreateTemplatePackage(Obj finTemplates, Dict meta)

Creates a template package to be published to StackHub

Accepts as parameters:

  • finTemplates:
    • An Urifor a folder in the `io/` folder under current project. for example: `io/templates/vendorName` To create an resource extension, one will need to create a file called podNameFuncs.trio (see the name tag in the meta Dict). Any trio file that's named fstTemplateNameTags.trio will be included in the templates section of this package and the tags added to the template record. If bacnetProperties.trio file is present, then it will be added to the package also.
    • A list of Refs ids to file records or Records of file tags pointing to FinStack Template files uploaded using the file upload method in the curent project
  • meta: a dictionary with properties that will identify the resulting packaged template Contains fields that are exported to the Pods meta.props file, like:
    • name
    • version
    • summary

Returns:

  • a Grid containing the id to the resulting template package

Examples:

finCreateTemplatePackage(`io/templates/acmeinc`, {name: "acmeTemplates", version: "1.0"})
finCreateTemplatePackage([@fst1, @fst2], {name: "ACME templates", version: "1.0"})
finCreateTemplatePackage(readAll(file and fst), {name: "acmeTemplates", version: "1.0"})

finCreateTemplatePackage2 ​

@Axon static Grid finCreateTemplatePackage2(Obj finTemplates, Dict meta)


finCurrentDayInfo ​

@Axon { meta=... } static Grid finCurrentDayInfo(DateTime time := SysLib.now(), TimeZone tz := TimeZone.cur())

Returns a grid with the columns

daysLeftMonth daysLeftYear hoursLeftDay hoursPastDay daysPastMonth daysPastYear


finDiscoveryAdd ​

@Axon static Grid finDiscoveryAdd(List recordIds)

Add discovered item to system


finDiscoverySessionCleanup ​

@Axon static Void finDiscoverySessionCleanup(Ref discoveryId)

Destroy Discovery Session


finDiscoverySessionEnd ​

@Axon static Void finDiscoverySessionEnd(Ref discoveryId, Str? error := null)

Close Discovery Session


finDiscoveryStatusCheck ​

@Axon static Grid finDiscoveryStatusCheck(Ref discoveryId)

Get Discovery Status. Provide the discovery session id to get real time discovery results.


finElementOn ​

@Axon static Grid finElementOn(Obj? target, Str elementTag, Bool queryRelated := false)

FIN Element On This method will find records compatible with the target element based off of the elementTag.

Example: read(equip).finElementOn("form")

This example will find all of the forms that are compatible with the equipment found in the "read()" function.

finElementOn(@target, "graphic", true) - This will find all of the graphics whose graphicsOn tag contains a filter that matches the target.

  • target This is the target element that will be used as a test to find compatible elements.
  • elementTag This is the element type tag. if "form" is passed, it will search for the filter to be in "formOn" on the form records
  • queryRelated If this is true, it will also match elements whose filter evaluates to true for any record referenced by the target.

finElementsOn ​

@Axon static Grid finElementsOn(Obj? targets, Str elementTag, Bool queryRelated := false)

FIN Elements On This method will find records compatible with all of the target elements based off of the elementTag.

Example: read(equip).finElementOn("form")

This example will find all of the forms that are compatible with the equipment found in the "read()" function.

finElementOn(@target, "graphic", true) - This will find all of the graphics whose graphicsOn tag contains a filter that matches the target.

  • grid This is a list of the target elements that will be used as a test to find compatible elements.
  • elementTag This is the element type tag. if "form" is passed, it will search for the filter to be in "formOn" on the form records
  • queryRelated If this is true, it will also match elements whose filter evaluates to true for any record referenced by the target.

finEnergyAnnualMonthlyDayRollup ​

@Axon static Grid finEnergyAnnualMonthlyDayRollup(Obj? pRef, Fn? foldFc := null)

Given a point ID and a folding function (sum, avg, median, etc....) the result of the query will return a years worth of data, and it will create up to 31 columns of data. The columns will be Day 1, Day 2, Day 3, etc... The rows will be Jan, Feb, March, APril, May, June, etc....

It returns that exact formation please. If no folding function is specified, "sum" is used as default.

Has 2 parameters:

  • pRef: point reference
  • foldFc: a folding function (optional), default is "sum"

finEnergyAnnualMonthlyRollup ​

@Axon static Grid finEnergyAnnualMonthlyRollup(Obj? pRef, Fn? foldFc := null)

Given a point or list of points ID and a folding function (sum, avg, median, etc....), if the points have a history it would return a row for each point, and then have 12 months of columns in it, for the last year, folded using the given function. The columns will be point, jan, feb, mar, etc... The rows will be the points. Has 2 parameters: - pRef: point or list of point - foldFc: a folding function (optional), default is "avg"


finEnergyAnnualWkDayRollup ​

@Axon static Grid finEnergyAnnualWkDayRollup(Obj? pRef, Fn? foldFc := null)

Given a point ID and a folding function (sum, avg, median, etc....) the result of the query will return a years worth of data, and it will create up to 31 columns of data. The columns will be Day 1, Day 2, Day 3, etc... The rows will be Jan, Feb, March, APril, May, June, etc.... It returns that exact formation please. If no folding function is specified, "sum" is used as default. Has 2 parameters: - pRef: point reference - foldFc: a folding function (optional), default is "sum"


finEquipPointTagClone ​

@Axon static Grid finEquipPointTagClone(Ref fromEquipRef, List fromPointRefs, List tags, Str toEquipFilter, Bool copy := false)


finFileAndAssetDelete ​

@Axon static Grid finFileAndAssetDelete(Obj? projects)

Given a finProject or list of finProject records or refs the function will delete the finProject(s) and assets that are use only by this project. Returns a grid with all records that where deleted


finFindRecordByChild ​

@Axon { meta=... } static Grid finFindRecordByChild(Expr targetFilter, Expr childFilter)

This function is just like finFindRecordByChildDeep except this one only searches 1 level deep, and is way more effecient. This function would let you search for let's say all AHUs that have zone temp sensors under them. And it will return the AHUs. parameter-1 is a filter, which is typically a equip , and paramter-2 is a filter for what typically would be a point


finFindRecordByChildDeep ​

@Axon { meta=... } static Grid finFindRecordByChildDeep(Expr targetFilter, Expr childFilter)

This function will let you search for children of something. IE... IF you are looking for equipment that have temp sensors under item than this function will return all the equipment that have temp sensors. The normal folio filter does not let you do this. This function finFindRecordByChildDeep is just like finFindRecordByChild, so if you are looking for things and you only want to get the children that are one level deep, than use finFindRecordByChild. finFindRecordByChildDeep is more expensive as it is looking for all the children under what you find. parameter-1 is a filter, which is typically a site or floor, and paramter-2 is a filter for what typically would be a point


finFindRecordByChildInternal ​

static Grid finFindRecordByChildInternal(Expr targetExpr, Expr childExpr, Bool deepSearch := false, Str treeName := "equip")


finFixOldBinTags ​

@Axon static Grid finFixOldBinTags()


finFoldGrid ​

@Axon static Grid finFoldGrid(Grid grd, Fn? foldFc := null, Dict ops := Etc.emptyDict())


finFuncs ​

@Axon static Grid? finFuncs()

FIN Funcs This method merges the result of the funcs() query with extra data within the finFuncs.trio file to support FIN|Stack's code editor

Example: finFuncs()


finGetCaps ​

@Axon static Grid finGetCaps()

This function returns a grid with the licensing parts and their prices.


finGetConnectorTagSpecs ​

@Axon static Grid finGetConnectorTagSpecs(Str extName)

Returns a Grid with the tag specs defined for an enabled connector.


finGetCurrentUser ​

@Axon static Dict finGetCurrentUser()


finGetDiscoveryConfiguration ​

@Axon static Grid? finGetDiscoveryConfiguration(Str connectorName)

Get Discovery Configuration


finGetHelp ​

@Axon static Grid finGetHelp(Str[] appNames, Ref[]? targetRefs := null)


finHaystackDrillDown ​

@Axon static Grid finHaystackDrillDown(Obj? conns, Str? startLearn := "sep:/", Bool hisEnable := false, Str? rootLearn := "")

Takes a connector ref or a list of haystack connector refs and using the navTree supplied queries all the nav paths on each connector and creates an grid with all the entities that match the path.


finHaystackExcludedTags ​

@Axon static Grid finHaystackExcludedTags()

Returns a grid of tags to be excluded when working with records coming from haystack or nhaystack connectors


finHaystackLearn ​

@Axon static Grid finHaystackLearn(Obj? conn, Obj? learnPath := null, Map opts := [:])

Improves haystackLearn so that it fetches all the tags defined for a learn path


finHttpProxy ​

@Axon static Grid finHttpProxy(Uri url, Str method := "GET", Dict? headers := null, Dict? params := null)


finNavDrillDown ​

@Axon static Grid finNavDrillDown(Obj? start, Str navTree := "equip", Bool includeConns := false)

Gets all the children of the parent id or parent id list that matches the supplied navTree start - a ref or list of refs or a rec or list of records


finNavDuplicate ​

@Axon static Grid finNavDuplicate(Str treeName, Obj src, Dict? opts)

Duplicates a record using the nav tree specified by treeName This functions uses the built-in proj::SysLib.navDuplicate function with the important add-on of also duplication the children of the src record that have the same nav level as the source, i.e. sub-equips


finNavMain ​

@Axon static Grid finNavMain(Obj? targets, Obj? dates := null)


finNavMerge ​

@Axon static Grid? finNavMerge(Obj sourceRef, Obj targetRef, Str treeName := "equip", Bool moveTarget := true)


finNavMetaTagList ​

@Axon static Grid finNavMetaTagList(Obj target, Dict ops := Etc.emptyDict())

Given an record that is part of the equipPath Posible ops are {"drillDown":false, "values":true, "getRef":true} If drillDown is present: Find all unique tags that are used by the record and all it's nav children. Else finds all unique tags that are used by the record and all it's nav parents. If "drillDown" is not present but "values" is then the resulted grid includes the values for those tags also.


finNavNavlets ​

@Axon static Grid finNavNavlets(Obj? target, Obj? dates := null)


finNavRollup ​

@Axon static Grid finNavRollup(Grid grid)


finNavletsOn ​

@Axon static Grid finNavletsOn(Obj? target)


finNoteSummary ​

@Axon { meta=... } static Grid finNoteSummary(Grid notes)


finPaginate ​

@Axon static Grid finPaginate(Grid target, Number? pageNumber := Number.<ctor>(1), Number? itemsPerPage := Number.<ctor>(25))

FIN|Stack Paginate This method will paginate the data of the grid passed to it.

  • target This is the target Grid to be paginated.
  • pageNumber This is the page number requested. (Optional, defaults to 1)
  • itemsPerPage This is the number of items per page (Optional, defaults to 25)

Example: readAll(point).finPaginate(1, 25)

The resulting grid will contain 5 metadata tags

  • paginated is a marker that defines this grid as being a paginated grid
  • currentPage is the current page number of the result (requested)
  • itemsPerPage is the requested items per page.
  • totalItems is the total number of items in the target grid.
  • totalPages is the total number of available pages

The resulting grid will also contain the original metadata tags defined by the target.

@return This method returns a paginated grid which is a subset of the target grid.


finParseFilter ​

@Axon static Grid finParseFilter(Expr filter)

Decode a filter expression into a grid of operands


finPointSummary ​

@Axon static Grid finPointSummary(Expr target, Expr equipExpr := Literal.nullVal, Expr pointExpr := Literal.nullVal)

Generate a point summary by equip:

  • target is id, dict, list of id, list of dicts which determines base to use for <navFilter>. If null, then entire proj is queried.
  • equipFilter: filter for equip or null for all equip under target
  • pointFilter: filter for points or null for all points under equip

Return a table where ever row represents an equipment, and columns represent key tags on the points. The following cols are used:

  • id: equip id and dis
  • idX: point id and dis
  • curValX: curVal tag of each point
  • curDisX: display string for curVal for each point
  • curStatusX: curStatus tag of each point

The column's are grouped and use dis tag based on the navName of each point. The grid.meta defined numPoints to determine the number of point columns.

Examples:

finPointSummary(read(site))
finPointSummary(null, ahu)
finPointSummary(null, ahu, discharge and temp)

finPublishTemplatePackage ​

@Axon static Void finPublishTemplatePackage(Obj pod, Str username, Str password, Bool live := false)

Upload a template package to Stack Hub

Accepts as parameters:

  • pod: a String or Dict or Uri to the pod name, like `mytemplate.pod`. The Dict parameter must have an Uri tag called templatePod
  • username: the Stack Hub username
  • password: the Stack Hub password
  • live: publish to live account or the sand-box Stack Hub sites. Default is sand-box.

Examples:

finCreateTemplatePackage(`io/templates/acmeinc`, {name: "acmeTemplates", version: "1.0"}).finPublishTemplatePackage("user", "passwd")
finPublishTemplatePackage(`mytemplate.pod`, "user", "passwd")

finRebuildDocs ​

@Axon static Obj? finRebuildDocs()

Rebuilds the documentation using the FINStack style


finRebuildNavTree ​

@Axon static Void finRebuildNavTree(Str navLevel, Ref parentId := Ref.nullRef, Str navTreeName := "equip")

Rebuild a nav tree by ensuring that parent refs to and from the specified navLevel are bound to parents and children respectively An optional parent ref id can be supplied so that the rebuild is limited to the branch starting from that specific parent ref id.


finRecordTagClone ​

@Axon static Grid finRecordTagClone(Ref fromRef, Str toFilter, List tags)


finRemoveCategory ​

@Axon { meta=... } static Grid finRemoveCategory(Obj category)

Removes a category or a list of categories from all actions and user records

Users should call this like: // remove category foo_finCat finRemoveCategory("foo_finCat") // remove a list of categories finRemoveCategory(["foo_finCat", "bar_finCat"])


finScheduleCopyDays ​

@Axon { meta=... } static Grid finScheduleCopyDays(Obj schedRefs, Str srcDay, Str dstDay)

Change a weekly schedule (or list of weekly schedules) by copying parts of it to other week days

Examples:

// copy events from Monday to Tuesday finScheduleCopyDays(@schedRef, "mon", "tue") // copy events from Monday to all work days finScheduleCopyDays(@schedRef, "mon", "workWeek") // copy events from Monday to all week days finScheduleCopyDays(@schedRef, "mon", "everyDay") // using a list of schedule records, for each one, copy events from Monday to all work days finScheduleCopyDays([@schedRef1, @schedRef2], "mon", "workWeek")


finShowPointsInWatch ​

@Axon static Grid finShowPointsInWatch(Ref watchId)

List all records registered for a watch id


finShowWatches ​

@Axon static Grid finShowWatches()

List all watches open for this project


finStackBootStrap ​

@Axon static Grid finStackBootStrap()


finSub ​

@Axon static Obj? finSub(Expr expr)

Evaluate the given expression. If the expression results in a Dict or a Grid of records with an id tag, then add to them to the watch for the current evalAll. Must call finSubStart first.


finSubEnd ​

@Axon static Grid finSubEnd()

Last call of an evalAll for subscription. This returns an empty grid with the meta tag finSubWatch which contains the watch id of the current watch subscription.


finSubStart ​

@Axon static Grid finSubStart(Str graphicName, Str? watchId := null)

Open a new watch as part of an evalAll. The graphicName parameter should be the debug string for the watch. If watchId is null then a new watch is created, otherwise it must reference an existing watch.


finSyncTags ​

@Axon { meta=... } static Grid finSyncTags(Ref source, Str[] tags, Bool createIfNotExist := false, Str treeName := "equip")

FIN Synchronize Tags This method will recursively synchronize the tag values from the source onto all of the children down the given tree

Example:

finSyncTags(@SiteId, ["tz"])

This example will update the tz tag on all of the children down the tree. It will not create the tz tag if it does not exist on an item

finSyncTags(@SiteId, ["tz"], true) - This will update and/or create the tz tag on every item down the equip tree.
  • source This is the Ref to the source where the tag of interest exists. This is also the starting point in the tree that will be traversed.
  • tags This is a list of tags that will be copied from the source onto the descendants in the tree.
  • createIfNotExist If this is true, it will create the tags of interet on the descendants if they do not exist
  • treeName This is the name of the tree that we shall traverse and update

finTemplateCopy ​

@Axon static Grid finTemplateCopy(Ref source, Str basePath, Dict[] targets, Bool returnCloneIds := false)


finUniqueActions ​

@Axon { meta=... } static Grid finUniqueActions(Expr filter := Literal.nullVal, Expr includeRefs := Literal.falseVal)

Find all actions that have the same dis and expr tags Returns a grid with dis, expr, count rows to show how many similar actions were found. An optional filter expression can be provided which can narrow the search area that defaults to all actions.

Examples:

// returns all unique actions finUniqueActions() // returns unique actions for sensor finUniqueActions(sensor)


finUniqueTags ​

@Axon { meta=... } static Grid finUniqueTags(Expr filter := Literal.<ctor>("equip"))

finUniqueTags

  • returns a grid with all markers that are shared by records matching the filter and their match count

finUriToDict ​

@Axon static Dict finUriToDict(Uri uri)


finhaystackDeviceDiscovery ​

@Axon static Grid? finhaystackDeviceDiscovery(Obj? ref, Str? config)


finhaystackDeviceDiscoveryConfig ​

@Axon static Grid? finhaystackDeviceDiscoveryConfig()


finsedonaDeviceDiscovery ​

@Axon static Grid? finsedonaDeviceDiscovery(Obj? ref, Str? config)


finsedonaDeviceDiscoveryConfig ​

@Axon static Grid? finsedonaDeviceDiscoveryConfig()


getItemName ​

static Str getItemName(Dict item)


getRefTagsHelp ​

static List getRefTagsHelp(Dict rec, Dict row, List eqPath, Dict ops := Etc.emptyDict(), Str preRef := "")


mergeTreeElements ​

static Void mergeTreeElements(Dict source, Dict target, Context cx, NavTree tree, Bool moveTarget)


moveItemIntoTree ​

static Dict moveItemIntoTree(Obj itemRef, Obj targetRef, Context cx, Str treeName := "equip")


HaystackDiscovery ​

class HaystackDiscovery : Obj

Haystack discovery mechanics

Methods

discoverWraps haystackExt::HaystackLib.haystackDiscover()

Slot Details ​


discover ​

static Grid discover(Obj id, Str? conf)

Wraps haystackExt::HaystackLib.haystackDiscover()


LanguageTable ​

class LanguageTable : Obj

Fields

LocaleTable

Methods

getLanguageName

Slot Details ​


LocaleTable ​

const static Map LocaleTable := ...


getLanguageName ​

static Str? getLanguageName(Str locale)


Navlet ​

class Navlet : Obj

Constructors

make

Fields

dis
filter
func
id
name
rec

Slot Details ​


dis ​

const Str dis


filter ​

const Filter filter


func ​

const Fn func


id ​

const Ref id


make ​

new make(Context cx, Dict rec)


name ​

const Str name


rec ​

const Dict rec


NavletPipeline ​

class NavletPipeline : Obj

NavletPipeline manages loading the navlets and using them for the various navlet functions.

Constructors

make

Fields

allNavlets
cx
ext

Methods

navMain
navMainRec
navNavlets
navletEval
navletsOn
readNavletsOn
toImage
toSummary1
toSummary2

Slot Details ​


allNavlets ​

Navlet[] allNavlets


cx ​

Context cx


ext ​

Ext ext


make ​

new make()


Grid navMain(Dict[] recs, DateSpan dates)


Dict navMainRec(Dict rec, DateSpan dates)


Grid navNavlets(Dict rec, DateSpan dates)


Dict? navletEval(Navlet n, Dict rec, DateSpan dates)


Navlet[] navletsOn(Dict rec)


readNavletsOn ​

Grid readNavletsOn(Dict rec)


toImage ​

Ref toImage(Dict rec)


toSummary1 ​

Str toSummary1(Dict rec)


toSummary2 ​

Str toSummary2(Dict rec)


SedonaDiscovery ​

class SedonaDiscovery : Obj

Sedona discovery mechanics

Methods

discoverWraps sedonaExt::SedonaLib.sedonaDiscover()

Slot Details ​


discover ​

static Grid discover(Obj id, Str? conf)

Wraps sedonaExt::SedonaLib.sedonaDiscover()