活动频道
默认事件 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 Field 将事件分为以下几类:
| 值 | 说明 |
|---|---|
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 | 这是外汇代码。 |
{
"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 | 这是外汇代码。 |
{
"name": "sdf-sdf_hfx-range-exited",
"category": "feature",
"level": "notice",
"data": {
"session_id": 3,
"device_id": "1A2B",
"hfx_id": "my_fx_name"
},
"message": ""
}