Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mushiny-rms-sdk-samples
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-projects
mushiny-rms-sdk-samples
Commits
1e609380
Commit
1e609380
authored
Mar 02, 2022
by
Kevin Yuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
两个例子
parent
c05428cb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
ToteSDKClentSample.java
...java/com/mushiny/examplecode/tote/ToteSDKClentSample.java
+87
-0
No files found.
java/example_code/tote_sdk_sample/src/main/java/com/mushiny/examplecode/tote/ToteSDKClentSample.java
View file @
1e609380
package
com
.
mushiny
.
examplecode
.
tote
;
import
com.mushiny.totesdk.config.ClientConfig
;
import
com.mushiny.totesdk.dto.task.ToteCallRep
;
import
com.mushiny.totesdk.dto.task.ToteCallReq
;
import
com.mushiny.totesdk.http.ToteSDKClient
;
import
com.mushiny.totesdk.http.task.ToteAGVTaskActionType
;
import
com.mushiny.totesdk.http.task.ToteTaskItem
;
import
com.mushiny.totesdk.listen.ToteAGVArriveStationListener
;
import
com.mushiny.totesdk.listen.ToteTaskStatusChangeListener
;
import
com.mushiny.totesdk.listen.message.TaskStatusChangeMessage
;
import
com.mushiny.totesdk.listen.message.ToteAGVArriveStationMessage
;
import
com.mushiny.totesdk.station.BinCellIdType
;
import
com.mushiny.totesdk.station.RollerStation
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
ToteSDKClentSample
{
public
static
void
main
(
String
[]
args
)
{
// sectionId
Integer
sectionId
=
1
;
//RMS服务器IP
String
toteRMSServerIP
=
"127.0.0.1"
;
//RMS服务端口
Integer
port
=
8086
;
//RMS接口访问token
String
token
=
""
;
ClientConfig
clientConfig
=
new
ClientConfig
(
sectionId
,
toteRMSServerIP
,
port
,
token
);
//获取一个client
ToteSDKClient
toteSDKClient
=
ToteSDKClient
.
getInstance
(
clientConfig
);
// createInBoundPutTote(toteSDKClient);
createInBoundCallAGVTask
(
toteSDKClient
);
}
/**
* 创建 料箱呼叫车到工作站任务
* @param toteSDKClient
*/
public
static
void
createInBoundCallAGVTask
(
ToteSDKClient
toteSDKClient
){
ToteCallReq
toteCallReq
=
new
ToteCallReq
();
RollerStation
rollerStation
=
new
RollerStation
();
rollerStation
.
setId
(
"76-70"
);
rollerStation
.
setCellId
(
70
);
rollerStation
.
setType
(
BinCellIdType
.
OUT
);
rollerStation
.
setBinDepth
(
1085
);
rollerStation
.
setDirection
(
1
);
rollerStation
.
setBinHeight
(
512
);
toteCallReq
.
setWorkStation
(
rollerStation
);
//注册到站通知
toteSDKClient
.
registerArriveStationListener
(
new
ArriveStationListener
());
//注册任务状态改变通知
toteSDKClient
.
registerTaskStatusChangeListener
(
new
TaskStatusChangeListener
());
ToteCallRep
toteCallRep
=
toteSDKClient
.
createInBoundCallAGVTask
(
toteCallReq
.
getWorkStation
());
System
.
out
.
println
(
"料箱呼叫车到工作站任务,taskId[{"
+
toteCallRep
.
getTaskId
()
+
"}]"
);
}
/**
* 创建 料箱呼叫车到工作站放料箱任务
* @param toteSDKClient
*/
public
static
void
createInBoundPutTote
(
ToteSDKClient
toteSDKClient
)
{
//注册到站通知
toteSDKClient
.
registerArriveStationListener
(
new
ArriveStationListener
());
//注册任务状态改变通知
toteSDKClient
.
registerTaskStatusChangeListener
(
new
TaskStatusChangeListener
());
List
<
ToteTaskItem
>
toteTaskItems
=
new
ArrayList
<>();
ToteTaskItem
toteTaskItem
=
new
ToteTaskItem
();
toteTaskItem
.
setToteAGVTaskActionType
(
ToteAGVTaskActionType
.
PUT
);
toteTaskItem
.
setBinCode
(
"1AB002RC01R04000"
);
toteTaskItems
.
add
(
toteTaskItem
);
ToteCallRep
toteCallRep
=
toteSDKClient
.
createInBoundPutToteTask
(
toteTaskItems
,
"1"
);
System
.
out
.
println
(
"料箱呼叫车到工作站放料箱任务,toteCallRep[{"
+
toteCallRep
+
"}]"
);
}
}
class
ArriveStationListener
implements
ToteAGVArriveStationListener
{
@Override
public
void
arriveStation
(
ToteAGVArriveStationMessage
arriveStationMessage
)
{
System
.
out
.
println
(
"收到任务到站通知, TaskId[{"
+
arriveStationMessage
.
getTaskId
()
+
"}]"
);
}
}
class
TaskStatusChangeListener
implements
ToteTaskStatusChangeListener
{
@Override
public
void
receiveTaskStatusChangeMessage
(
TaskStatusChangeMessage
taskStatusChangeMessage
)
{
System
.
out
.
println
(
"收到任务状态改变通知, TaskId[{"
+
taskStatusChangeMessage
.
getTaskId
()
+
"}]"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment