活动频道
默认事件 websocket URL 为 ws://localhost:10020.
可以在配置中更改端口。
这是一个低频单向通信通道,可接收所有系统事件。 不支持输入信息。
该通道保证为每个事件发送一条信息。
标准格式
所有活动都遵循如下所示的标准结构:
{
"name": "device-connected",
"category": "device",
"level": "notice",
"data": {},
"message": ""
}
字段说明
| 现场 | 类型 | 说明 |
|---|---|---|
name | string | 事件的唯一标识符。 |
category | string | 用于筛选和组织的分组标签(见有效类别)。 |
level | string | 事件的严重性或重要性(见有效级别)。 |
data | object | 包含特定事件详细信息的有效载荷。 |
message | string | 事件的可选人工可读描述或上下文。 |
活动类别
"(《世界人权宣言》) category 总部外办事处将活动分为以下几组
| 价值 | 说明 |
|---|---|
system | 核心或中央系统、全局设置等。 |
input | 外部输入处理(如命令或其他)。 |
session | 与特定用户会话相关的事件。 |
device | 设备管理、控制器交互、串行端口通信。 |
module | 子系统或模块组件事件。 |
feature | 与特定服务特性或功能相关的事件。 |
活动级别
活动 level 字段表示事件的严重性或重要性:
| 价值 | 说明 |
|---|---|
info | 仅供参考 - 日志、指标或非关键性通知。 |
notice | 国家变化或重大事件。 |
warning | 出错或似乎有问题,但系统可以安全继续运行。 |
error | 出现可能影响系统行为或稳定性的问题。 |
critical | 严重破坏系统功能的严重错误。 |
panic | 灾难性故障 - 可能导致崩溃或无法恢复的状态。 |
活动
信息
该列表是系统目前报告的事件列表。我们正在积极设计和扩展事件类型和报告。
输入
invalid-io-channel
当以不支持或非预期方式使用 I/O 通道时触发。
数据
| 现场 | 类型 | 说明 |
|---|---|---|
received_data | string | 收到的原始数据。 |
{
"name": "invalid-io-channel",
"category": "input",
"level": "warning",
"data": {
"received_data": "<raw_input_here>"
}
}
http-route-deprecated
当某个 HTTP 路由已被废弃,并将在未来版本中移除时,会触发此提示。
数据
| 现场 | 类型 | 说明 |
|---|---|---|
route | string | 已弃用的路径。 |
substitute | string | 推荐的替代品。 |
{
"name": "http-route-deprecated",
"category": "input",
"level": "warning",
"data": {
"route": "/the/old/way",
"substitute": "/the/new/way"
}
}
settings-invalid-key
当设置键无效时触发。
数据
| 现场 | 类型 | 说明 |
|---|---|---|
key | string | 那把没找到的钥匙。 |
{
"name": "settings-invalid-key",
"category": "input",
"level": "warning",
"data": {
"key": "devices/none-existent/key"
}
}
command-deprecated
当接收到的命令已过时并将在未来版本中删除时发出。
| 现场 | 类型 | 说明 |
|---|---|---|
command | string | 收到的废弃命令 |
{
"name": "command-deprecated",
"category": "input",
"level": "warning",
"data": {
"command": "example_cmd"
},
"message": "The command `example_cmd` is deprecated and is replaced by `this_one`."
}
设备
device-connected
表示设备已连接并已完全运行。
| 现场 | 类型 | 说明 |
|---|---|---|
device_family | string | 设备类型: inverse 或 verse_grip. |
device_id | string | 设备的唯一标识符。 |
{
"name": "device-connected",
"category": "device",
"level": "notice",
"data": {
"device_family": "inverse",
"device_id": "04BA"
}
}
device-disconnected
表示先前连接的设备已断开连接。
| 现场 | 类型 | 说明 |
|---|---|---|
device_family | string | 设备类型: inverse 或 verse_grip. |
device_id | string | 设备的唯一标识符。 |
{
"name": "device-disconnected",
"category": "device",
"level": "notice",
"data": {
"device_family": "verse_grip",
"device_id": "61548"
}
}
会话
device-low-control-rate
当设备的传入直接控制命令速率过低并触及安全限值时触发此提示。此提示表示 速率正在接近截止速率。
| 现场 | 类型 | 说明 |
|---|---|---|
session_id | int | 目标模拟会话 ID。 |
device_family | string | 设备类型: inverse 或 verse_grip. |
device_id | string | 设备的唯一标识符。 |
frequency | int | 您当前的控制频率(单位:赫兹)。 |
{
"name": "device-low-control-rate",
"category": "session",
"level": "warning",
"data": {
"session_id": 3,
"device_family": "inverse",
"device_id": "1A2B",
"frequency": 260
},
"message": ""
}
device-critical-control-rate
当设备接收到的直接控制命令速率过低并触及安全限值时触发此提示。
| 现场 | 类型 | 说明 |
|---|---|---|
session_id | int | 目标模拟会话 ID。 |
device_family | string | 设备类型: inverse 或 verse_grip. |
device_id | string | 设备的唯一标识符。 |
frequency | int | 您当前的控制频率(单位:赫兹)。 |
{
"name": "device-critical-control-rate",
"category": "session",
"level": "error",
"data": {
"session_id": 3,
"device_family": "inverse",
"device_id": "1A2B",
"frequency": 82
},
"message": ""
}
功能
sdf-sdf_hfx-created
在创建 SDF 实体 FX 时生成。
| 现场 | 类型 | 说明 |
|---|---|---|
session_id | int | 目标模拟会话 ID。 |
device_id | string | 设备的唯一标识符。 |
hfx_id | string | 创建该对象时使用的 FX ID。 |
{
"name": "sdf-sdf_hfx-created",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-deleted
当删除 SDF 实体 FX 时触发。
| 现场 | 类型 | 说明 |
|---|---|---|
session_id | int | 目标模拟会话 ID。 |
device_id | string | 设备的唯一标识符。 |
hfx_id | string | 已删除的FX ID。 |
{
"name": "sdf-sdf_hfx-deleted",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-updated
当 SDF 实体 FX 被更新时触发。
| 现场 | 类型 | 说明 |
|---|---|---|
session_id | int | 目标模拟会话 ID。 |
device_id | string | 设备的唯一标识符。 |
hfx_id | string | 更新后的FX ID。 |
{
"name": "sdf-sdf_hfx-updated",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-range-entered
当指定设备的光标进入 SDF 实体范围时触发。
| 现场 | 类型 | 说明 |
|---|---|---|
session_id | int | 目标模拟会话 ID。 |
device_id | string | 设备的唯一标识符。 |
hfx_id | string | FX ID。 |
{
"name": "sdf-sdf_hfx-range-entered",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}
sdf-sdf_hfx-range-exited
当指定设备的光标移出 SDF 实体范围时触发。
| 现场 | 类型 | 说明 |
|---|---|---|
session_id | int | 目标模拟会话 ID。 |
device_id | string | 设备的唯一标识符。 |
hfx_id | string | FX ID。 |
{
"name": "sdf-sdf_hfx-range-exited",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}