Skip to content

lib-arcbeam 库参考 ​

原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793783460/FIN+5.3.1+lib-arcbeam 中文整理基于 FIN 5.3.1

导读: Arcbeam 连接器扩展

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


目录(导读) ​

  • lib
  • meta
  • docs
  • tags
  • funcs
  • views
  • def
  • usage
  • supertypes
  • tags
  • Overview
  • Setup
  • Advantages
  • Reverse Proxy
  • Niagara Arcbeam
  • arcbeamCall(conn, name, args: [,])
  • arcbeamEval(conn, expr)
  • arcbeamRead(conn, filterExpr, checked: true)
  • arcbeamReadAll(conn, filterExpr, opts: null)
  • arcbeamReadById(conn, id, checked: true)
  • arcbeamReadByIds(conn, ids, checked: true)
    • src

概述(中译) ​

Arcbeam 连接器扩展


API 正文(英文) ​

docs ​

Overview • Setup • Advantages • Reverse Proxy • Niagara Arcbeam


tags ​

arcbeamConnArcbeam connector
arcbeamConnRefUsed on a proxy point to reference its parent arcbeamConn
arcbeamCurUsed on a arcbeam proxy point to store the id of the entity in the remote system used to read and watch curVal
arcbeamHisUsed on a arcbeam proxy point object to store the id of the historized point in the remote system used to sync history data
arcbeamMinEventTimeApplied to arcbeamConn to tune how fast the server should send current value updates
arcbeamPointPoint which synchronizes data via a arcbeam connector
arcbeamWriteUsed on a arcbeam proxy point to store the id of the entity in the remote system used to write writeVal
arcbeamWriteLevelNumber between 1 and 16 used with arcbeamWrite to determine which priority level of the remote system is written to

funcs ​

arcbeamCallEvaluate a platform specific operation on the remote node
arcbeamEvalEvaluate a platform specific expression on the remote node
arcbeamReadRead a single record from remote node with filter and return as a dict
arcbeamReadAllRead a grid of records from remote node with a filter
arcbeamReadByIdRead a record from the remote node by its unique id and return as dict
arcbeamReadByIdsRead a list of records from remote node by their identifiers

views ​

arcbeamNodesProject database of arcbeam connector nodes


def ​

arcbeamConn ​

Arcbeam connector


meta ​

connFeatures
defarcbeamConn
iconarcbeam
isconn
liblib:arcbeam

usage ​

arcbeamConn  conn

supertypes ​

markerMarker labels a dict with typing information
entityTop-level dicts with a unique identifier
connConnector for communication to a remote system

tags ​

actorTimeoutTimeout for messages send to the connector's actor thread
arcbeamMinEventTimeApplied to arcbeamConn to tune how fast the server should send current value updates
connErrError message associated when connStatus indicates an error condition
connLingerLinger timeout used to keep a connector open
connOpenRetryFreqDuration used for connector open retries
connPingFreqDuration used to configure the auto-ping feature on a given connector
connStateCurrent connection state of a connector as one of the predefined strings
connStatusCurrent status of a connector as one of the predefined strings See Connectors
connTuningRefReference to a tuning configuration defined by a connTuning rec
disDisplay name for an entity
disabledIndicates the entity is in a disabled state
idDefines the unique identifier of an entity in system using a ref value type
isolateIsolate this node from making inbound requests
nodeIdNode id as string without the n: prefix
pubKeyPublic key as encoded string
uriUniversal resource identifier


def ​

arcbeamConnRef ​

Used on a proxy point to reference its parent arcbeamConn


meta ​

defarcbeamConnRef
isref
liblib:arcbeam
ofarcbeamConn
tagOnarcbeamPoint

supertypes ​

valData value type
scalarScalar is an atomic value kind
refReference to an entity


def ​

arcbeamCur ​

Used on a arcbeam proxy point to store the id of the entity in the remote system used to read and watch curVal.


meta ​

defarcbeamCur
isstr
liblib:arcbeam
tagOnarcbeamPoint

supertypes ​

valData value type
scalarScalar is an atomic value kind
strUnicode string of characters


def ​

arcbeamHis ​

Used on a arcbeam proxy point object to store the id of the historized point in the remote system used to sync history data.


meta ​

defarcbeamHis
isstr
liblib:arcbeam
tagOnarcbeamPoint

supertypes ​

valData value type
scalarScalar is an atomic value kind
strUnicode string of characters


def ​

arcbeamMinEventTime ​

Applied to arcbeamConn to tune how fast the server should send current value updates.


meta ​

defarcbeamMinEventTime
isduration
liblib:arcbeam
tagOnarcbeamConn
val1sec

supertypes ​

valData value type
scalarScalar is an atomic value kind
numberInteger or floating point numbers annotated with an optional unit
durationNumber with a unit of time


def ​

arcbeamPoint ​

Point which synchronizes data via a arcbeam connector.


meta ​

defarcbeamPoint
isconnPoint
liblib:arcbeam

usage ​

arcbeamPoint  point

supertypes ​

markerMarker labels a dict with typing information
entityTop-level dicts with a unique identifier
pointData point such as a sensor or actuator
connPointPoint associated with a connector for data synchronization with a remote system

tags ​

arcbeamConnRefUsed on a proxy point to reference its parent arcbeamConn
arcbeamCurUsed on a arcbeam proxy point to store the id of the entity in the remote system used to read and watch curVal
arcbeamHisUsed on a arcbeam proxy point object to store the id of the historized point in the remote system used to sync history data
arcbeamWriteUsed on a arcbeam proxy point to store the id of the entity in the remote system used to write writeVal
arcbeamWriteLevelNumber between 1 and 16 used with arcbeamWrite to determine which priority level of the remote system is written to
connTuningRefReference to a tuning configuration defined by a connTuning rec
curSupports current value
curCalibrationCalibration value to apply to adjust the value read from the connector before updating curVal
curConvertConversion to apply when reading curVal from connector
disDisplay name for an entity
disMacroDisplay name using macro syntax
disabledIndicates the entity is in a disabled state
enumDefines an eumeration of string key names
equipRefReference to equip which contains this entity
ghgFactorHisIdentifies point record with interval emission factor data that the Greenhouse Gas Emission Engine uses to calculate emissions
hisSupports historization of data
hisConvertConversion to apply when reading history data from connector
idDefines the unique identifier of an entity in system using a ref value type
kindKind name used to identity a value data type
maxValInclusive maximum for a numeric value
minValInclusive minimum for a numeric value
navNameNavigation name commonly used with disMacro to create computed display strings
pointFunctionClassifies the point as a sensor, command, or setpoint
pointQuantityQuantity the point senses or controls
pointSubjectWhat the point senses or controls
siteRefReference to site which contains the entity
spaceRefReference to space which contains this entity
systemRefReference to system
tzTimezone identifier from standard timezone database
unitUnit identifier from standard unit database
writableSupports writing data
writeConvertConversion to apply when writing writeVal to the connector


def ​

arcbeamWrite ​

Used on a arcbeam proxy point to store the id of the entity in the remote system used to write writeVal.


meta ​

defarcbeamWrite
isstr
liblib:arcbeam
tagOnarcbeamPoint

supertypes ​

valData value type
scalarScalar is an atomic value kind
strUnicode string of characters


def ​

arcbeamWriteLevel ​

Number between 1 and 16 used with arcbeamWrite to determine which priority level of the remote system is written to.


meta ​

defarcbeamWriteLevel
defVal16
isint
liblib:arcbeam
maxVal16
minVal1
tagOnarcbeamPoint

supertypes ​

valData value type
scalarScalar is an atomic value kind
numberInteger or floating point numbers annotated with an optional unit
intUnitless integer number

lib arcbeam ​

Overview ​

The Arcbeam extension implements a full connector using the arcbeam protocol which is also used for clustering. The Arcbeam connector supports the full suite of connector functionality including:

  • Learn tree navigation
  • Current value one-time syncs via connSyncCur()
  • Current value subscriptions for change-of-value updates
  • History sync via connSyncHis()
  • Point writes

Setup ​

The Arcbeam connector only runs in SkySpark and requires active maintenance. You may connect to any of the following systems:

  • Another SkySpark project running the arcbeam extension
  • A Haxall node with an enabled cluster extension
  • A Niagara node with the "arcbeam-rt.jar" installed (see Niagara Setup section)

In SkySpark the node URI is ws://{host}:{port}/api/{proj} (or wss: if using TLS). Note that unlike cluster you must specify the project name in the URI.

Advantages ​

Using arcbeam for a connector provides several advantages over other protocols such as Haystack:

  • Flexibility to tunnel through firewalls
  • WebSocket avoids TCP/HTTP overhead on each message
  • Binary message encoding (Brio) is more efficient

Reverse Proxy ​

If SkySpark is deployed behind a reverse proxy, such as Nginx, then additional configuration is required for arcbeam connections.

For Nginx, a new location block can be added for the project where the arcbeam extension is enabled:

location = /api/{projname}/ { #UPDATE PROJECT NAME
  proxy_pass http://skyspark.local:8080; #UPDATE LOCAL SKYSPARK ADDRESS/PORT
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $http_connection;
  proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol;
}

Alternatively, the default location can be updated:

location / {
  proxy_pass http://skyspark.local:8080; #UPDATE LOCAL SKYSPARK ADDRESS/PORT
  proxy_set_header Host $host;
  proxy_http_version 1.1;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Proto http;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $http_connection;
  proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol;
}

Niagara Arcbeam ​

SkyFoundry supports an Arcbeam integration with the Niagara Framework. Please refer to the Niagara Arcbeam App Note for more information.



def ​

func:arcbeamCall ​

arcbeamCall(conn, name, args: [,]) ​

Evaluate a platform specific operation on the remote node.

For SkySpark and Haxall nodes, this will remotely evaluate an Axon function using the same semantics as the call() function. The the current local user is used on the remote node.

Niagara nodes support a specific set of calls discussed in the Niagara Arcbeam docs. Note that Niagara nodes do not support Haystack ops.

Examples:

// Haxall node
arcbeamCall(@conn, "about")

meta ​

admin✓
deffunc:arcbeamCall
isfunc
liblib:arcbeam
namearcbeamCall

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:arcbeamEval ​

arcbeamEval(conn, expr) ​

Evaluate a platform specific expression on the remote node.

For SkySpark and Haxall nodes, this will remotely evaluate an Axon expression. The the current local user is used on the remote node.

Examples:

arcbeamEval(@conn, "readAll(equip)")

meta ​

admin✓
deffunc:arcbeamEval
isfunc
liblib:arcbeam
namearcbeamEval

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:arcbeamRead ​

arcbeamRead(conn, filterExpr, checked: true) ​

Read a single record from remote node with filter and return as a dict. If not found, then return null or raise UnknownRecErr based on checked flag.

Examples:

arcbeamRead(@conn, ahu and equip)

meta ​

admin✓
deffunc:arcbeamRead
isfunc
liblib:arcbeam
namearcbeamRead

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:arcbeamReadAll ​

arcbeamReadAll(conn, filterExpr, opts: null) ​

Read a grid of records from remote node with a filter.

Supported options for all remote node types:

  • limit: Number for max number of results

Supported Niagara Options

Examples:

arcbeamReadAll(@conn, ahu and equip)
arcbeamReadAll(@conn, ahu and equip, {limit:10})

meta ​

admin✓
deffunc:arcbeamReadAll
isfunc
liblib:arcbeam
namearcbeamReadAll

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:arcbeamReadById ​

arcbeamReadById(conn, id, checked: true) ​

Read a record from the remote node by its unique id and return as dict. If the record is not found, then return null or raise UnknownRecErr based on checked flag.

Examples:

arcbeamReadById(@conn, @xyx-123)

meta ​

admin✓
deffunc:arcbeamReadById
isfunc
liblib:arcbeam
namearcbeamReadById

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

func:arcbeamReadByIds ​

arcbeamReadByIds(conn, ids, checked: true) ​

Read a list of records from remote node by their identifiers. Return a grid where each row of the grid maps to the respective id list (indexes line up). If checked is true and any one of the ids cannot be resolved then raise UnknownRecErr for first id not resolved. If checked is false, then each id not found has a row where every cell is null.

Examples:

arcbeamReadByIds(@conn, [@abc-123, @xyx-123])

meta ​

admin✓
deffunc:arcbeamReadByIds
isfunc
liblib:arcbeam
namearcbeamReadByIds

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function


def ​

view:arcbeamNodes ​

Project database of arcbeam connector nodes


meta ​

admin✓
appNameconn
defview:arcbeamNodes
disKeyui::arcbeam
iconview
isview
liblib:arcbeam

supertypes ​

featureFeature namespace of definitions formatted as feature:name
viewFresco UI view

src ​

view:       {inherit:"table"}
local:      {action:"arcbeamLocal" uiInput:"uiMisc::ClusterActions.local"}
hubDebug:   {dis:"Hub Debug" action:"arcbeamHubDebug"}
nodeDebug:  {dis:"Node Debug" action:"arcbeamNodeDebug" select}
watchDebug: {dis:"Watch Debug" action:"arcbeamWatchDebug" select}
new:        {action:"arcbeamNew"}
edit:       {action:"recEdit" defName:"arcbeamConn"}
trash :     {action:"recTrash"}
enable:     {action:"recEnable"}
disable:    {action:"recDisable"}
approve:    {action:"arcbeamApprove" select}
data:       {expr:"arcbeamNodes()"}