外观
lib-sedona 库参考
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793587139/FIN+5.3.1+lib-sedona 中文整理基于 FIN 5.3.1
导读: Sedona Sox 连接器
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- lib
- meta
- docs
- tags
- funcs
- views
- Overview
- Connectors
- Points
- Manifests
- sedonaPing(conn)
- sedonaReadComp(conn, compId)
- sedonaSyncCur(points)
- sedonaWrite(conn, addr, val)
概述(中译)
Sedona Sox 连接器
API 正文(英文)
docs
Overview • Connectors • Points • Manifests
tags
| sedonaConn | Sedona Sox connector to a remote device |
| sedonaConnRef | Used on a proxy point to reference its parent sedonaConn |
| sedonaCur | Sedona address to use for current value subscritions |
| sedonaPoint | Point which synchronizes data via a Sedona connector |
| sedonaWrite | Sedona address to use for writing |
funcs
| sedonaPing | Deprecated - use connPing() |
| sedonaReadComp | Synchronously read the current state of the component identified by the given component identifier |
| sedonaSyncCur | Deprecated - use connSyncCur() |
| sedonaWrite | Synchronously write a property |
views
| sedonaManifests | Manage the local database of Sedona manifest files |
lib sedona
Overview
This library provides a connector for the Sedona Sox protocol. Sox is a binary UDP protocol for comminication to controllers which run the Sedona Framework control engine.
The sedona connector provides the following features:
- Learn support to walk the remote device component tree
- COV subscription to any component property
- Writable support to any component property
Connectors
Sedona client connectors are configured with the following tags:
conn: required marker tagsedonaConn: required marker taguri: formatted as "sox://host:port" such as "sox://192.168.1.88:1876"username: user name for authenticationpassword: must have password stored in password db for connector's record id
After the first ping the following meta data tags are available:
- sedonaVersion
- sedonaPlatform
Points
Points use the following tags:
sedonaPoint: required marker tagsedonaConnRef: associated connectorsedonaCur: address to subscribe for curValsedonaWrite: address to write for a local writable point
The address strings are formatted as "compId.slot". An example address might be "4.out" where the compId is the component's integer identifier and slot is the string name.
Manifests
Sedona connectors require a manifest XML file for each kit used by the remote devices. Manifests are stored under in the var/etc directory using this naming convention:
{var}/etc/sedona/manifests/{kit}/{kit}-{checksum.xml}For example the "math" kit manifest with a checksum of "c22b255c" would be stored in the following file:
{var}/etc/sedona/manifest/math/math-c22b255c.xmlIf running SkySpark, then manifests may be managed under the Sedona Manifests view under the Connectors app.
def
func:sedonaPing
sedonaPing(conn)
Deprecated - use connPing()
meta
| admin | ✓ |
| def | func:sedonaPing |
| deprecated | ✓ |
| is | func |
| lib | lib:sedona |
| name | sedonaPing |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:sedonaReadComp
sedonaReadComp(conn, compId)
Synchronously read the current state of the component identified by the given component identifier.
meta
| admin | ✓ |
| def | func:sedonaReadComp |
| is | func |
| lib | lib:sedona |
| name | sedonaReadComp |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:sedonaSyncCur
sedonaSyncCur(points)
Deprecated - use connSyncCur()
meta
| admin | ✓ |
| def | func:sedonaSyncCur |
| deprecated | ✓ |
| is | func |
| lib | lib:sedona |
| name | sedonaSyncCur |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:sedonaWrite
sedonaWrite(conn, addr, val)
Synchronously write a property
meta
| admin | ✓ |
| def | func:sedonaWrite |
| is | func |
| lib | lib:sedona |
| name | sedonaWrite |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
sedonaConn
Sedona Sox connector to a remote device.
meta
| connFeatures | |
| def | sedonaConn |
| icon | sedona |
| is | conn |
| lib | lib:sedona |
usage
| sedonaConn conn |
supertypes
| marker | Marker labels a dict with typing information |
| entity | Top-level dicts with a unique identifier |
| conn | Connector for communication to a remote system |
tags
| actorTimeout | Timeout for messages send to the connector's actor thread |
| connErr | Error message associated when connStatus indicates an error condition |
| connLinger | Linger timeout used to keep a connector open |
| connOpenRetryFreq | Duration used for connector open retries |
| connPingFreq | Duration used to configure the auto-ping feature on a given connector |
| connState | Current connection state of a connector as one of the predefined strings |
| connStatus | Current status of a connector as one of the predefined strings See Connectors |
| connTuningRef | Reference to a tuning configuration defined by a connTuning rec |
| dis | Display name for an entity |
| disabled | Indicates the entity is in a disabled state |
| id | Defines the unique identifier of an entity in system using a ref value type |
| password | Manages password which is hashed/stored to the password store |
| uri | Universal resource identifier |
| username | Username for an authentication account |
def
sedonaConnRef
Used on a proxy point to reference its parent sedonaConn
meta
| def | sedonaConnRef |
| is | ref |
| lib | lib:sedona |
| of | sedonaConn |
| tagOn | sedonaPoint |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| ref | Reference to an entity |
def
sedonaCur
Sedona address to use for current value subscritions. Formatted as "compId.slot".
meta
| def | sedonaCur |
| is | str |
| lib | lib:sedona |
| tagOn | sedonaPoint |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| str | Unicode string of characters |
def
sedonaPoint
Point which synchronizes data via a Sedona connector.
meta
| def | sedonaPoint |
| is | connPoint |
| lib | lib:sedona |
usage
| sedonaPoint point |
supertypes
| marker | Marker labels a dict with typing information |
| entity | Top-level dicts with a unique identifier |
| point | Data point such as a sensor or actuator |
| connPoint | Point associated with a connector for data synchronization with a remote system |
tags
| connTuningRef | Reference to a tuning configuration defined by a connTuning rec |
| cur | Supports current value |
| curCalibration | Calibration value to apply to adjust the value read from the connector before updating curVal |
| curConvert | Conversion to apply when reading curVal from connector |
| dis | Display name for an entity |
| disMacro | Display name using macro syntax |
| disabled | Indicates the entity is in a disabled state |
| enum | Defines an eumeration of string key names |
| equipRef | Reference to equip which contains this entity |
| ghgFactorHis | Identifies point record with interval emission factor data that the Greenhouse Gas Emission Engine uses to calculate emissions |
| his | Supports historization of data |
| hisConvert | Conversion to apply when reading history data from connector |
| id | Defines the unique identifier of an entity in system using a ref value type |
| kind | Kind name used to identity a value data type |
| maxVal | Inclusive maximum for a numeric value |
| minVal | Inclusive minimum for a numeric value |
| navName | Navigation name commonly used with disMacro to create computed display strings |
| pointFunction | Classifies the point as a sensor, command, or setpoint |
| pointQuantity | Quantity the point senses or controls |
| pointSubject | What the point senses or controls |
| sedonaConnRef | Used on a proxy point to reference its parent sedonaConn |
| sedonaCur | Sedona address to use for current value subscritions |
| sedonaWrite | Sedona address to use for writing |
| siteRef | Reference to site which contains the entity |
| spaceRef | Reference to space which contains this entity |
| systemRef | Reference to system |
| tz | Timezone identifier from standard timezone database |
| unit | Unit identifier from standard unit database |
| writable | Supports writing data |
| writeConvert | Conversion to apply when writing writeVal to the connector |
def
sedonaWrite
Sedona address to use for writing. Formatted as "compId.slot".
meta
| def | sedonaWrite |
| is | str |
| lib | lib:sedona |
| tagOn | sedonaPoint |
supertypes
| val | Data value type |
| scalar | Scalar is an atomic value kind |
| str | Unicode string of characters |
def
view:sedonaManifests
Manage the local database of Sedona manifest files
meta
| admin | ✓ |
| appName | conn |
| def | view:sedonaManifests |
| dis | Sedona Manifests |
| icon | view |
| is | view |
| lib | lib:sedona |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| view | Fresco UI view |
src
view: { inherit:"table" }
upload: { disKey:"ui::upload" upload multi action:"sedonaKitManifestUpload" }
debug: { disKey:"ui::view" action:"sedonaKitManifestView" select }
delete: { disKey:"ui::delete" action:"sedonaDeleteKitManifests" select multi confirm:{dis:"Delete manifests?" details:"This will permanently delete the files from manifest directory."}}
data: { expr:"sedonaKitManifests()" }