帮助中心
帮助中心主页
调度系统介绍
RoboView库位管理
回调
新分组
拼合单
运单
动作块策略
Roboview
动作块状态变化回调

功能

动作块状态变化时,向指定的对象发送消息。

使用方法

在RoboShop中配置Core的模型文件:

  1. 选择topic

在topic下拉框中选择需要接受的消息类型
对应动作块状态回调的topic为: BlockStateChange

  1. 设置receiver

目前支持HTTP类型的回调目标。
需要配置的参数有

参数名称参数位置单位默认值最小值最大值
ip模型文件-Receiver-receiver-HTTP-127.0.0.1 -
接受回调的IP地址,不包含 http://前缀,不支持DNS解析
port模型文件-Receiver-receiver-HTTP-12345 -
接受回调的端口
path模型文件-Receiver-receiver-HTTP-/block-state-change -
接受回调的请求路径

报文内容

字段名称描述例子
topictopicBlockStateChange
timestamp消息生成的时间戳2022-10-27T08:23:11Z
content字符串,消息内容,根据topic变化{\"binTask\":\"\",\"blockId\":\"16668589915700-b\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP15\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":

动作块状态变化回调的 content字段内容和 通过动作块 id 查询动作块状态 接口返回的内容一致, content字段为json序列化后的字符串。

例子

Core和服务器运行在同一台电脑上,本地HTTP服务器监听 http://0.0.0.0:12345,Core中的模型文件配置为:

图中的配置下,在动作块状态变化时,会用 POST方法,向 http://127.0.0.1:12345/block-state-change发送消息。
动作块的重要状态如下:

  • RUNNING: 动作块开始执行
  • FINISHED: 动作块完成(执行完成或手动完成都是完成)
  • STOPPED: 动作块终止
  • FAILED: 动作块执行失败,可以重试

机器人执行两个动作块,HTTP服务器收到的请求如下:

http
/block-state-change POST
Accept: */*
Content-Length: 406
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34500
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-b\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP15\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"RUNNING\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:11Z",
"topic": "BlockStateChange"
}
/block-state-change POST
Accept: */*
Content-Length: 406
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34420
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-b\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP15\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"POSTING\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:16Z",
"topic": "BlockStateChange"
}
/block-state-change POST
Accept: */*
Content-Length: 406
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34420
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-b\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP15\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"WAITING\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:16Z",
"topic": "BlockStateChange"
}
/block-state-change POST
Accept: */*
Content-Length: 407
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34420
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-b\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP15\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"FINISHED\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:16Z",
"topic": "BlockStateChange"
}
/block-state-change POST
Accept: */*
Content-Length: 406
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34420
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-c\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP16\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"RUNNING\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:16Z",
"topic": "BlockStateChange"
}
/block-state-change POST
Accept: */*
Content-Length: 406
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34432
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-c\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP16\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"POSTING\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:22Z",
"topic": "BlockStateChange"
}
/block-state-change POST
Accept: */*
Content-Length: 406
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34432
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-c\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP16\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"WAITING\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:22Z",
"topic": "BlockStateChange"
}
/block-state-change POST
Accept: */*
Content-Length: 407
Content-Type: application/json
Host: 127.0.0.1:12345
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 34432
User-Agent: cpp-httplib/0.10.0
{
"content": "{\"binTask\":\"\",\"blockId\":\"16668589915700-c\",\"containerName\":\"\",\"goodsId\":\"\",\"group\":\"\",\"location\":\"AP16\",\"manuallyFinished\":false,\"operation\":\"\",\"operation_args\":{},\"orderId\":\"16668589915700\",\"postAction\":{},\"script_args\":{},\"script_name\":\"\",\"state\":\"FINISHED\",\"vehicle\":\"sim_02\"}",
"timestamp": "2022-10-27T08:23:22Z",
"topic": "BlockStateChange"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
最近更新 2022/11/28
文章内容

功能

使用方法

报文内容

例子