外观
lib-point 库参考
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793882343/FIN+5.3.1+lib-point 中文整理基于 FIN 5.3.1
导读: 点历史化和可写支持
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- lib
- meta
- docs
- tags
- funcs
- views
- def
- supertypes
- Overview
- Point Cur
- Point Writes
- Point His
- His Collect
- Enum Meta
- Point Conversion
- enumDef(id, checked: true)
- enumDefs()
- equipToPoints(equip)
- hisCollectWriteAll(timeout: null)
- matchPointVal(val, match)
- pointAuto(point)
- pointConvert(pt, convert, val)
- pointDetails(point)
- pointEmergencyAuto(point)
- pointEmergencyOverride(point, val)
- pointOverride(point, val, duration: null)
- pointOverrideCommand(point, val, level, duration: null)
- pointSetDef(point, val)
- pointThermistorTables()
- pointWrite(point, val, level, who: null, opts: null)
- pointWriteArray(point)
- toDevices(recs)
- toEquips(recs)
- toOccupied(rec, checked: true)
- toPoints(recs)
- toSites(recs)
- toSpaces(recs)
- tags
- src
概述(中译)
点历史化和可写支持
API 正文(英文)
docs
Overview • Point Cur • Point Writes • Point His • His Collect • Enum Meta • Point Conversion
tags
| curTracksWrite | When configured curVal automatically tracks changes to writeVal and curStatus is set to "ok" |
| enumMeta | Project singleton record with enumeration name/code definitions |
| hisCollectCov | Enables COV history collection of the curVal |
| hisCollectCovRateLimit | Rate limits the frequency for hisCollectCov |
| hisCollectInterval | Enables interval history collection of the curVal |
| hisCollectNA | Historize the NA value whenever the curVal is null or curStatus is not equal to "ok" |
| hisCollectWriteFreq | This tag configures how long to buffer collected history items in memory before flushing them to the historian |
| obsPointWrites | Subscribe to writable point priority array updates - see docs |
| sitePoint | Marker tag applied to a point to indicate the point is site-wide |
funcs
| enumDef | Return definition of given enum def defined by enumMeta This call forces a refresh of the definitions |
| enumDefs | Return grid of current enum defs defined by enumMeta |
| equipToPoints | Given a equip record Dict, return a grid of its points |
| hisCollectWriteAll | Write all hisCollect items buffered in memory to the historian |
| matchPointVal | Return if a point value matches a given critera |
| pointAuto | User level-8 manual auto (override release) of writable point |
| pointConvert | Evaluate a point conversion |
| pointDetails | Get debug string for point including writables and his collection |
| pointEmergencyAuto | User level-1 manual auto (override release) of writable point |
| pointEmergencyOverride | User level-1 manual override of writable point |
| pointOverride | User level-8 manual override of writable point |
| pointOverrideCommand | Issue a point override command based on current user's access control permissions |
| pointSetDef | Set the relinquish default value (level-17) of writable point |
| pointThermistorTables | Return grid of thermistor table names as grid with one name column |
| pointWrite | Set a writable point's priority array value at the given level |
| pointWriteArray | Return the current priority array state of a writable point |
| toDevices | Map a set of recs to to a grid of devices |
| toEquips | Map a set of recs to to a grid of equips |
| toOccupied | Given a site, space, equip, or point rec, get its occupied point |
| toPoints | Map a set of recs to to a grid of points |
| toSites | Map a set of recs to to a grid of sites |
| toSpaces | Map a set of recs to to a grid of spaces |
views
| monitorEquips | Monitor the current value of points for selected equipment |
| monitorPoints | Monitor the current value of selected points |
def
curTracksWrite
When configured curVal automatically tracks changes to writeVal and curStatus is set to "ok". This tag is ignored if the current value is bound to connector.
meta
| def | curTracksWrite |
| is | marker |
| lib | lib:point |
| tagOn | cur-point |
supertypes
| marker | Marker labels a dict with typing information |
lib point
Overview
The point library is used to manage the standard functionality of point records that model sensors, commands, and setpoints. Important features of this library are management of the 16-level priority array for writable points and local history collection.
Point Cur
The term cur indicates synchronization of a point's current real-time value. By real-time we typically mean freshness within the order of of a few seconds. By convention a fooCur tag is used to configure the address used by the connector for current value synchronization. If a point has a real-time current value, then it must be annotated with the cur marker tag.
The following transient tags are used to model the current value and status:
curVal: current value of the point as Number, Bool, or StrcurStatus: ok, stale, down, fault, disabled, unknown, remoteDown, remoteFault, remoteDisabled, or remoteUnknowncurErr: error message if curStatus indicated error- additional details such as last ok/fail times, curErr stack trace, etc are available in the connector app via the "Details" command
If the point's connector is not in the "ok" state, then it inherits its error state for curStatus.
Because the current value might be changing several times a second, the tags above are managed transiently. This means they are not written to disk, nor persisted between server restarts. Changes to these tags are written to Folio using transient diffs.
The current value of points are synchronized one of two ways:
- one-time synchronization is made using the connectors
fooSyncCur()function - the point is added to a watch
Watches indicate an ongoing, live subscription of the point. Depending on the remote system this might involve an actual subscription over the network protocol. But for simpler protocols which only support polling, this means frequent polling of the point until its watch expires.
Point Writes
Writable points allow for control an output point or setpoint in a remote system via a connector. Writable points are modeled on the BACnet 16-level priority array with a relinquish default which effectively acts as level 17.
Any point rec can be turned into a writable point by adding the writable tag. Writable points should be cmd or sp points (never sensor points). Writable points must be mapped to a connector to actually command anything. By convention a fooWrite tag is used to configure the writable address.
The following levels have special behavior:
- Level 1: highest priority reserved for emergency overrides
- Level 8: manual override with ability to set timer to expire back to auto
- Default: implicitly acts as level 17 for relinquish default
The priority array provides for contention resolution when many different control applications are vying for control of a given point. Low level applications like scheduling typically control levels 14, 15, or 16. Then users can override at level 8. But a higher levels like 2 to 7 can be used to trump a user override (for example a demand response energy routine that requires higher priority).
The effective value to write is resolved by starting at level 1 and working down to relinquish default to find the first non-null value. It is possible for all levels to be null, in which case the overall write output is null (which in turn may be auto/null to another system). Anytime a null value is written to a priority level, we say that level has been set to auto or released (this allows the next highest level to take command of the output).
Whenever the priority array's effective value is modified, then the following tags are transiently updated:
writeVal: this is the current "winning" value of the priority array, or if this tag is missing then the winning value is nullwriteLevel: number from 1 to 17 indicate the winning priority array levelwriteStatus: status of the connector's ability to write the last value: ok, disabled, down, fault. The special status "unbound" indicates a writable point that is not bound to an actual connectorwriteErr: indicates the error message if writeStatus is error condition
Because the write value might be changing several times a second, the tags above are managed transiently. This means they are not written to disk, nor persisted between server restarts. Changes to these tags are written to Folio using transient diffs. They are recalculated on reboot.
Level 1, level 8, and default are special in that they are persistent. Changes to these levels will persist their value in Folio using the tags write1, write8, and writeDef. Timed overrides are not persistent. All other priority levels are transient - it is expected that control applications rewrite these levels on reboot.
The following Axon functions are used to write points:
pointEmergencyOverride()pointEmergencyAuto()pointOverride()pointAuto()pointSetDef()
There is also a pointWrite() function which allows forced writing to any level. But in general user interfaces should restrict access to the functions above to ensure users stick with levels 1, 8, and relinquish default. The pointWriteArray() function is used to read the current state of a point's write array.
The functions above all require the admin user permission. User interfaces should use the pointOverrideCommand() function. This function allows the framework to grant override permissions to specific points. In SkySpark this is configured with the pointOverrideAccess tag (not supported in Haxall).
Point His
Points which are historized are annotated with the his marker tag. Any point may be historized in one of two ways:
- conn sync: if the remote system supports its own data logging facilities, then the point's connector should implement history synchronization
- collect: the point history may be be collected locally using COV or interval sampling
The following tags are used to model the current value and status:
hisStatus: ok, down, fault, disabled, pending, syncing, unknownhisErr: error message if hisStatus indicated error- additional details such as last ok/fail times, hisErr stack trace, etc are available in the connector app via the "Details" command
If the point's connector is not in the "ok" state, then it inherits its error state for hisStatus. History synchronization is performed using the connSyncHis() function which must be manually scheduled using the task lib.
His Collect
Many remote systems may not support local historization of their data points. Or even when supported it may not be enabled for the desired points. In these cases, you can setup history collection locally in the Haxall server. Local collection requires that the a connector (or some application) is updating the curVal tag.
History collection is setup in two ways:
hisCollectCov: setups up change of value collectionhisCollectInterval: setups up interval sample collection
You can combine these tags to perform both COV and interval collection. A recommended practice is to setup bool/enum/ and numeric setpoints using COV, but also with an interval of 1day. For sampled numeric sensor values an interval of 1min to 15min is recommended with a COV tolerance to log rapid swings in the data.
The following tags may be used to tune local history collection:
hisCollectNA: used to log NA when status is not "ok"hisCollectCovRateLimit: used to throttle rapidly changing datahisCollectWriteFreq: used to buffer items in RAM before flushing to Folio
IMPORTANT NOTE: it is always preferable to use remote collection with history synchronization instead of local collection when possible. Remote collection has the following advantages:
- is always more efficient
- ensures no data is lost during network outages
- is much easier to tune since increasing the sync frequency does not result in data loss
Enum Meta
Connectors communicating with remote systems often use integer codes instead of string names for enumerated points. The mappings between string names and integer codes is managed by a singleton record with the enumMeta marker tag. Each string tag defines an enum definition. The name of the tag defines the enum identifier. The value is a string formatted as a Zinc grid with a name and code column.
Here is an example:
dis:"Enum Definitions"
enumMeta
switchState:
ver:"3.0"
name,code
"off",0
"on",1
speed:
ver:"3.0"
name,code
"unknown",-1
"off",0
"slow",1
"fast",2The record is annotated with the enumMeta marker tag. There should only be one record in each project with this tag. In our example above there are two enum defs named "switchState" and "speed". We can use these names with point conversion as follows:
// convert 0 to "off", 1 to "slow" and 2 to "fast"
enumNumberToStr(speed)
// convert "off" to 0, "slow" to 1, and "fast" to 2
enumStrToNumber(speed)A given name or given code may be double mapped, in which case the first mapping is defined as the normalized mapping. Consider this example:
// definition grid
ver:"3.0"
name,code
"alpha",0
"alpha",1
"beta",99
"gamma",99
// the mappings from the grid above are defined as follows
alpha => 0
beta => 99
gamma => 99
0 => alpha
1 => alpha
99 => betaAn enum definition may also be used to map to/from string/booleans. When mapping from a name to a boolean, any non-zero code is mapped as true and zero code as false. The first non-zero and zero name/code pair defines the mapping from boolean to string. For example:
// definition grid
ver:"3.0"
name,code
off,0
disabled,0
slow,1
fast,2
// mappings for booleans
off => false
disabled => false
slow => true
fast => true
false => off // first zero code
true => slow // first non-zero codeThe following functions may be used to query the enum definitions in effect:
enumDefs(): query the list of enum defs defined by enumMetaenumDef(): query name/code mapping of a specific enum def
Point Conversion
Point conversions are used to convert between the representations of external systems and the normalized local representations. They are used by the connector framework with the curConvert, writeConvert, and hisConvert tags. Use cases include:
- mathematical conversions of raw modbus registers
- type conversions
- enum mappings between string/number and string/boolean
- sensor voltage resets
- sensor thermistor tables
- unit conversion from fieldbus devices
You can test conversions via the pointConvert() function.
Examples:
// multiply raw value by 100
* 100
// multiply raw value by 100 and add 75
* 100 + 75
// convert °C to °F
°C => °F
// replace unit without conversion like 'as()' Axon function
as(°F)
// raise to the power of given exponent
pow(-1)
// reset 5-10 to 0-100
reset(5, 10, 0, 100)
// thermistor table; run pointThermistorTables() for full list
thermistor(10k-2)
// invert bool true -> false, vice versa
invert()
// swap endianness of unsigned two byte integer
u2SwapEndian()
// swap endianness of unsigned four byte integer
u4SwapEndian()
// zero to false, non-zero to true
numberToBool()
// parsing and formatting numbers
strToNumber() // checked defaults to true
strToNumber(true) // throws exception is not valid number
strToNumber(false) // evaluates to null if not a valid number
hexToNumber() // parse hex string
numberToStr() // convert number to a string
numberToHex() // convert number to a hex string
// bool functions
boolToNumber() // convert false to 0 and true to 1
boolToNumber(2, 4) // convert false to 2 and true to 4
// string functions
lower() // convert string to lowercase (ASCII only)
upper() // convert string to uppercsae (ASCII only)
strReplace('x', '_') // replace "x" with "_"
strReplace(' ', '') // replace space with the empty string
// enumeration conversions where 'x' is tag on enumMeta; if 'x' is
// "self" then use 'enum' tag on the record itself to map zero based ordinals
enumStrToNumber(x) // checked defaults to true
enumStrToNumber(x,true) // throws exception is mapping not defined
enumStrToNumber(x,false) // evaluates to null if mapping not defined
enumNumberToStr(x)
enumStrToBool(x)
enumBoolToStr(x)
// elvis operator will pass thru non-null values, or
// convert null to given value
?: true // non-null value or Bool true
?: false // non-null value or Bool false
?: NA // non-null value or NA
?: 123 // non-null value or Number 123
?: foo // non-null value or Str "foo"
strToNumber(false) ?: 0 // parse as number or 0 as fallbackFormal grammar for convert tags:
<conv> := <expr> <expr>*
<expr> := <math> | <bit> | <elvis> | <unit> | <func>
<math> := <add> | <sub> | <mul> | <div>
<add> := "+" <float>
<sub> := "-" <float>
<mul> := "*" <float>
<div> := "/" <float>
<bit> := <and> | <or> | <xor> | <shiftr> | <shiftl>
<and> := "&" <int>
<or> := "|" <int>
<xor> := "^" <int>
<shiftr> := ">>" <int>
<shiftl> := "<<" <int>
<elvis> := "?:" <literal>
<unit> := <from> "=>" <to>
<func> := <id> "(" <args> ")"
<args> := <arg> ("," <arg>)*
<literal> := "true" | "false" | <float> | <str>Functions:
as(unit)
invert()
pow(exp)
min(limit)
max(limit)
reset(inLo, inHi, outLo, outHi)
thermistor(table-name)
u2SwapEndian()
u4SwapEndian()
numberToBool()
strToNumber(checked)
hexToNumber(checked)
numberToStr()
numberToHex()
lower()
upper()
strReplace(from, to)
enumStrToNumber(enumDef, checked)
enumStrToBool(enumDef, checked)
enumNumberToStr(enumDef, checked)
enumBoolToStr(enumDef)Note that multiple conversions can be piped together by separating them with a space. They are always evaluated left to right (there is no precedence for math operators).
def
enumMeta
Project singleton record with enumeration name/code definitions. See point.
meta
| def | enumMeta |
| is | marker |
| lib | lib:point |
supertypes
| marker | Marker labels a dict with typing information |
def
func:enumDef
enumDef(id, checked: true)
Return definition of given enum def defined by enumMeta This call forces a refresh of the definitions.
meta
| def | func:enumDef |
| is | func |
| lib | lib:point |
| name | enumDef |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:enumDefs
enumDefs()
Return grid of current enum defs defined by enumMeta. This call forces a refresh of the definitions.
meta
| def | func:enumDefs |
| is | func |
| lib | lib:point |
| name | enumDefs |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:equipToPoints
equipToPoints(equip)
Given a equip record Dict, return a grid of its points. If this function is overridden you MUST NOT use an XQuery to resolve points; this function must return local only points.
meta
| def | func:equipToPoints |
| is | func |
| lib | lib:point |
| name | equipToPoints |
| overridable | ✓ |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:hisCollectWriteAll
hisCollectWriteAll(timeout: null)
Write all hisCollect items buffered in memory to the historian. Block until complete or until timeout exceeded.
meta
| admin | ✓ |
| def | func:hisCollectWriteAll |
| is | func |
| lib | lib:point |
| name | hisCollectWriteAll |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:matchPointVal
matchPointVal(val, match)
Return if a point value matches a given critera:
- match any values which are equal via
==operator - zero matches false (0% ==> false)
- non-zero matches true (not 0% ==> true)
- numerics can be matches with range
- match can be a function which takes the value
Examples:
matchPointVal(false, false) >> true
matchPointVal(0, false) >> true
matchPointVal(33, false) >> false
matchPointVal(33, true) >> true
matchPointVal(33, 0..40) >> true
matchPointVal(90, 0..40) >> false
matchPointVal(4) x => x.isEven >> truemeta
| def | func:matchPointVal |
| is | func |
| lib | lib:point |
| name | matchPointVal |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointAuto
pointAuto(point)
User level-8 manual auto (override release) of writable point. See pointWrite().
meta
| admin | ✓ |
| def | func:pointAuto |
| is | func |
| lib | lib:point |
| name | pointAuto |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointConvert
pointConvert(pt, convert, val)
Evaluate a point conversion. First parameter is point to test (anything accepted by toRec()) or null to use empty dict.
Examples:
pointConvert(null, "+ 2 * 10", 3)
pointConvert(null, "hexToNumber()", "ff")
pointConvert(null, "°C => °F", 20°C)meta
| def | func:pointConvert |
| is | func |
| lib | lib:point |
| name | pointConvert |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointDetails
pointDetails(point)
Get debug string for point including writables and his collection. The argument is anything acceptable by toRec(). The result is returned as a plain text string.
Examples:
read(dis=="My Point").pointDetails
pointDetails(@2b80f96a-820a4f1a)meta
| def | func:pointDetails |
| is | func |
| lib | lib:point |
| name | pointDetails |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointEmergencyAuto
pointEmergencyAuto(point)
User level-1 manual auto (override release) of writable point. See pointWrite().
meta
| admin | ✓ |
| def | func:pointEmergencyAuto |
| is | func |
| lib | lib:point |
| name | pointEmergencyAuto |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointEmergencyOverride
pointEmergencyOverride(point, val)
User level-1 manual override of writable point. See pointWrite().
meta
| admin | ✓ |
| def | func:pointEmergencyOverride |
| is | func |
| lib | lib:point |
| name | pointEmergencyOverride |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointOverride
pointOverride(point, val, duration: null)
User level-8 manual override of writable point. If duration is specified it must be a number with unit of time that indicates how long to put the point into override. After the duration expires, the point is set back to auto (null). See pointWrite().
meta
| admin | ✓ |
| def | func:pointOverride |
| is | func |
| lib | lib:point |
| name | pointOverride |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointOverrideCommand
pointOverrideCommand(point, val, level, duration: null)
Issue a point override command based on current user's access control permissions
meta
| def | func:pointOverrideCommand |
| is | func |
| lib | lib:point |
| name | pointOverrideCommand |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointSetDef
pointSetDef(point, val)
Set the relinquish default value (level-17) of writable point. See pointWrite().
meta
| admin | ✓ |
| def | func:pointSetDef |
| is | func |
| lib | lib:point |
| name | pointSetDef |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointThermistorTables
pointThermistorTables()
Return grid of thermistor table names as grid with one name column
meta
| def | func:pointThermistorTables |
| is | func |
| lib | lib:point |
| name | pointThermistorTables |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointWrite
pointWrite(point, val, level, who: null, opts: null)
Set a writable point's priority array value at the given level. The point may be any value accepted by toRec(). Level must be 1 to 17 (where 17 represents def value). The who parameter is a string which represent debugging information about which user or application is writing to this priorirty array level. If who is omitted, then the current user's display string is used
meta
| admin | ✓ |
| def | func:pointWrite |
| is | func |
| lib | lib:point |
| name | pointWrite |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:pointWriteArray
pointWriteArray(point)
Return the current priority array state of a writable point. The point may be any value accepted by toRec(). The result is returned grid with following columns:
- level: number from 1 - 17 (17 is default)
- levelDis: human description of level
- val: current value at level or null
- who: who last controlled the value at this level
meta
| def | func:pointWriteArray |
| is | func |
| lib | lib:point |
| name | pointWriteArray |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:toDevices
toDevices(recs)
Map a set of recs to to a grid of devices. The recs parameter may be any value accepted by toRecList(). Return empty grid if no mapping is found. The following mappings are supported:
- recs with
devicetag are mapped as themselves - recs with
deviceReftag are mapped to their parent device - recs with
siteare mapped to devices with parentsiteRef - recs with
spaceare mapped to devices with parentspaceRef - recs with
equipare mapped to devices with parentequipRef
Examples:
read(site).toDevices // return children devices within site
read(space).toDevices // return children devices within space
read(equip).toDevices // return children devices within equip
read(point).toDevices // return point's parent devicemeta
| def | func:toDevices |
| is | func |
| lib | lib:point |
| name | toDevices |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:toEquips
toEquips(recs)
Map a set of recs to to a grid of equips. The recs parameter may be any value accepted by toRecList(). Return empty grid if no mapping is found. The following mappings are supported:
- recs with
equiptag are mapped as themselves - recs with
equipReftag are mapped to their parent equip - recs with
siteare mapped to equip with parentsiteRef - recs with
spaceare mapped to equip with parentspaceRef
Examples:
read(site).toEquips // return children equip within site
read(space).toEquips // return children equip within space
read(equip).toEquips // return equip itself
read(point).toEquips // return point's parent equipmeta
| def | func:toEquips |
| is | func |
| lib | lib:point |
| name | toEquips |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:toOccupied
toOccupied(rec, checked: true)
Given a site, space, equip, or point rec, get its occupied point. The following algorithm is used to lookup the occupied point:
- Try to find in equip or parent of nested equip
- Try to find in space or parent of nested spaces
- Try to find in site if site if tagged as
sitePoint
If there are no matches or multiple ambiguous matches, then return null or raise an exception based on checked flag.
meta
| def | func:toOccupied |
| is | func |
| lib | lib:point |
| name | toOccupied |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:toPoints
toPoints(recs)
Map a set of recs to to a grid of points. The recs parameter may be any value accepted by toRecList(). Return empty grid if no mapping is found. The following mappings are supported:
- recs with
pointtag are mapped as themselves - recs with
siteare mapped to points with parentsiteRef - recs with
spaceare mapped to points with parentspaceRef - recs with
equipare mapped to points with parentequipRef - recs with
deviceare mapped to points with parentdeviceRef
Examples:
read(site).toPoints // return children points within site
read(space).toPoints // return children points within space
read(equip).toPoints // return children points within equip
read(device).toPoints // return children points within devicemeta
| def | func:toPoints |
| is | func |
| lib | lib:point |
| name | toPoints |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:toSites
toSites(recs)
Map a set of recs to to a grid of sites. The recs parameter may be any value accepted by toRecList(). Return empty grid if no mapping is found. The following mappings are supported:
- recs with
sitetag are mapped as themselves - recs with
siteReftag are mapped to their parent site
Examples:
read(site).toSites // return site itself
read(space).toSites // return space's parent site
read(equip).toSites // return equip's parent site
read(point).toSites // return point's parent sitemeta
| def | func:toSites |
| is | func |
| lib | lib:point |
| name | toSites |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:toSpaces
toSpaces(recs)
Map a set of recs to to a grid of spaces. The recs parameter may be any value accepted by toRecList(). Return empty grid if no mapping is found. The following mappings are supported:
- recs with
spacetag are mapped as themselves - recs with
spaceReftag are mapped to their parent space - recs with
siteare mapped to spaces with parentsiteRef
Examples:
read(site).toSpaces // return children spaces within site
read(equip).toSpaces // return equip's parent space
read(point).toSpaces // return point's parent space
read(space).toSpaces // return space itselfmeta
| def | func:toSpaces |
| is | func |
| lib | lib:point |
| name | toSpaces |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
hisCollectCov
Enables COV history collection of the curVal. The tag value must be Marker to collect on any change. Or if the point is Numeric, then the value may be a Number which indicates the tolerance a point must change before logged.
COV collection is rate throttled using a limit determined as follows:
- use
hisCollectCovRateLimitif configured - if a numeric with
hisCollectInterval, then never collect faster than 1/10 of the interval or 1min (whichever is lower) - if a numeric without
hisCollectIntervalthen use 1min as rate limit - fallback to 1sec rate limit for non-numerics
Also see point.
meta
| def | hisCollectCov |
| is | marker, number |
| lib | lib:point |
| tagOn | his-point |
supertypes
| marker | Marker labels a dict with typing information |
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| number | Integer or floating point numbers annotated with an optional unit |
def
hisCollectCovRateLimit
Rate limits the frequency for hisCollectCov. When configured COV logging will never log any faster than this frequency. For example if set to 10sec, then the historian will log no faster than every 10sec even if the underlying data is changing every second.
meta
| def | hisCollectCovRateLimit |
| is | duration |
| lib | lib:point |
| tagOn | his-point |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| number | Integer or floating point numbers annotated with an optional unit |
| duration | Number with a unit of time |
def
hisCollectInterval
Enables interval history collection of the curVal. The value must be a duration Number with a "sec", "min," or "hr" unit:
- if secondly, then must be divisible evenly into a 60sec minute
- if minutely, then must be evenly divisible into a 60min hour
- if hourly, then must be evenly divisible into a 24hr day
Also see point.
meta
| def | hisCollectInterval |
| defVal | 1min |
| is | duration |
| lib | lib:point |
| maxVal | 1day |
| minVal | 1sec |
| tagOn | his-point |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| number | Integer or floating point numbers annotated with an optional unit |
| duration | Number with a unit of time |
def
hisCollectNA
Historize the NA value whenever the curVal is null or curStatus is not equal to "ok". If this marker is omitted, then no value is logged in this sitaution. This behavior may be changed on for the entire project by adding this tag as a point setting.
meta
| def | hisCollectNA |
| is | marker |
| lib | lib:point |
| tagOn | his-point |
supertypes
| marker | Marker labels a dict with typing information |
def
hisCollectWriteFreq
This tag configures how long to buffer collected history items in memory before flushing them to the historian. If this tag is missing, then collected items are immediately flushed to the historian and to disk. But when this tag is configured with a duration number, items are be buffered in memory and then written to the historian in batch. Batch writes enable more efficient compression of the history data and allows you to tune how often data is fsync'ed to disk.
meta
| def | hisCollectWriteFreq |
| is | duration |
| lib | lib:point |
| tagOn | his-point |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| number | Integer or floating point numbers annotated with an optional unit |
| duration | Number with a unit of time |
def
obsPointWrites
Subscribe to writable point priority array updates - see docs
meta
| def | obsPointWrites |
| is | obsRecs |
| lib | lib:point |
supertypes
| marker | Marker labels a dict with typing information |
| observable | Observable subscription - see docs |
| obsRecs | Base class for observables on database records |
tags
| obsFilter | Filter string to define the record data set observed |
def
sitePoint
Marker tag applied to a point to indicate the point is site-wide. For example an occupied point that models the occupancy of the entire building should be tagged as a sitePoint.
meta
| def | sitePoint |
| is | marker |
| lib | lib:point |
supertypes
| marker | Marker labels a dict with typing information |
def
view:monitorEquips
Monitor the current value of points for selected equipment
meta
| appName | monitor |
| def | view:monitorEquips |
| disKey | ui::equips |
| icon | view |
| is | view |
| lib | lib:point |
| order | 100 |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| view | Fresco UI view |
src
view: { inherit:"table" }
equips: { var input kind:"Ref<equip>[]" navSelAny share }
equipType: { var input kind:"Symbol" share uiInput:"ui::ChoiceInput" of:^equip defVal:^equip }
menu: { action:"uiContextMenu" }
data: { expr:"monitorEquips({{equips}}, {{equipType}})" }def
view:monitorPoints
Monitor the current value of selected points
meta
| appName | monitor |
| def | view:monitorPoints |
| disKey | ui::points |
| icon | view |
| is | view |
| lib | lib:point |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| view | Fresco UI view |
src
view: { inherit:"table" }
points: { var input kind:"Ref<anyPoint>[]" navSelAny share }
menu: { action:"uiContextMenu" }
data: { expr:"monitorPoints({{points}})" }