Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhmes-agecal
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
耿迪迪
zhmes-agecal
Commits
389633da
Commit
389633da
authored
Sep 17, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 扫托盘 上料 测试
parent
8b565379
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
RobotArmCommandServiceImpl.java
...ehong/system/service/impl/RobotArmCommandServiceImpl.java
+4
-3
FinalExecutionJob.java
...c/main/java/com/zehong/system/task/FinalExecutionJob.java
+10
-2
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/RobotArmCommandServiceImpl.java
View file @
389633da
...
...
@@ -104,10 +104,11 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
robotArmCommandMapper
.
selectPendingUnloadingCommands
();
if
(!
unloadingCommands
.
isEmpty
())
{
boolean
[]
roboticArmExitConveyorData
=
Modbus4jUtils
.
getRoboticArmExitConveyorData
();
if
(
roboticArmExitConveyorData
[
1
])
{
// boolean[] roboticArmExitConveyorData = Modbus4jUtils.getRoboticArmExitConveyorData();
// if(roboticArmExitConveyorData[1]) {
log
.
info
(
"开始处理上料指令: {}"
,
loadingCommands
.
get
(
0
));
sendCommand
(
unloadingCommands
.
get
(
0
),
"UNLOAD"
);
}
//
}
}
}
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/FinalExecutionJob.java
View file @
389633da
...
...
@@ -12,6 +12,7 @@ import com.zehong.system.mapper.TStoreyInfoMapper;
import
com.zehong.system.modbus.util.Modbus4jUtils
;
import
com.zehong.system.service.ITEquipmentAlarmDataService
;
import
com.zehong.system.service.ITStoreyInfoService
;
import
com.zehong.system.service.websocket.RobotArmWebSocketHandler
;
import
org.quartz.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -29,6 +30,8 @@ import java.util.Date;
public
class
FinalExecutionJob
implements
Job
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
FinalExecutionJob
.
class
);
@Resource
private
RobotArmWebSocketHandler
robotArmWebSocketHandler
;
@Resource
private
ITEquipmentAlarmDataService
alarmDataService
;
@Resource
...
...
@@ -75,7 +78,7 @@ public class FinalExecutionJob implements Job {
cleanUpJobs
(
fStoreyId
,
context
);
// 4. 发送 下料指令
createRoboticArm
(
tStoreyInfo
.
getfTrayCode
(),
tStoreyInfo
.
getfStoreyCode
());
createRoboticArm
(
tStoreyInfo
.
getfTrayCode
(),
tStoreyInfo
.
getfStoreyCode
()
,
tStoreyInfo
.
getBlankingCommand
()
);
log
.
info
(
"设备[{}]最终业务逻辑执行完成"
,
fStoreyId
);
}
catch
(
Exception
e
)
{
...
...
@@ -89,7 +92,7 @@ public class FinalExecutionJob implements Job {
}
}
private
void
createRoboticArm
(
String
trayCode
,
String
storeyCode
)
{
private
void
createRoboticArm
(
String
trayCode
,
String
storeyCode
,
String
command
)
{
// 创建机械臂任务
RobotArmCommand
robotArmCommand
=
new
RobotArmCommand
();
robotArmCommand
.
setType
(
"1"
);
...
...
@@ -97,7 +100,9 @@ public class FinalExecutionJob implements Job {
robotArmCommand
.
setTrayCode
(
trayCode
);
robotArmCommand
.
setStoreyCode
(
storeyCode
);
robotArmCommand
.
setCreateTime
(
new
Date
());
robotArmCommand
.
setCommand
(
command
);
robotArmCommandMapper
.
insertRobotArmCommand
(
robotArmCommand
);
notifyCommandsUpdate
();
}
private
void
cleanUpJobs
(
String
deviceId
,
JobExecutionContext
context
)
throws
SchedulerException
{
...
...
@@ -120,4 +125,7 @@ public class FinalExecutionJob implements Job {
throw
new
RuntimeException
(
e
);
}
}
private
void
notifyCommandsUpdate
()
{
robotArmWebSocketHandler
.
broadcastCommandUpdate
();
}
}
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