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
7d7496aa
Commit
7d7496aa
authored
Aug 22, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 调试
parent
afcc9713
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
3 deletions
+138
-3
RobotArmCommandController.java
...g/web/controller/equipment/RobotArmCommandController.java
+18
-0
IRobotArmCommandService.java
...va/com/zehong/system/service/IRobotArmCommandService.java
+4
-0
RobotArmCommandServiceImpl.java
...ehong/system/service/impl/RobotArmCommandServiceImpl.java
+24
-0
robotArmCommand.js
zhmes-agecal-web/src/api/robotArm/robotArmCommand.js
+17
-0
AgingCabinetBoard.vue
...cal-web/src/views/screen/components/AgingCabinetBoard.vue
+1
-1
RoboticArm.vue
zhmes-agecal-web/src/views/screen/components/RoboticArm.vue
+74
-2
No files found.
zhmes-agecal-admin/src/main/java/com/zehong/web/controller/equipment/RobotArmCommandController.java
View file @
7d7496aa
...
@@ -71,6 +71,24 @@ public class RobotArmCommandController extends BaseController
...
@@ -71,6 +71,24 @@ public class RobotArmCommandController extends BaseController
return
toAjax
(
robotArmCommandService
.
insertBlankingRobotArmCommand
(
robotArmCommand
));
return
toAjax
(
robotArmCommandService
.
insertBlankingRobotArmCommand
(
robotArmCommand
));
}
}
/**
* 发送归位指令
*/
@GetMapping
(
"/sendHomeCommand"
)
public
AjaxResult
sendHomeCommand
()
{
robotArmCommandService
.
sendHomeCommand
();
return
AjaxResult
.
success
(
"发送成功"
);
}
/**
* 停止当前指令
*/
@GetMapping
(
"/sendStopCommand"
)
public
AjaxResult
sendStopCommand
()
{
robotArmCommandService
.
sendStopCommand
();
return
AjaxResult
.
success
(
"发送成功"
);
}
/**
/**
* 新增机械臂指令
* 新增机械臂指令
*/
*/
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/IRobotArmCommandService.java
View file @
7d7496aa
...
@@ -66,6 +66,10 @@ public interface IRobotArmCommandService
...
@@ -66,6 +66,10 @@ public interface IRobotArmCommandService
void
completeCommand
(
Long
commandId
);
void
completeCommand
(
Long
commandId
);
void
sendHomeCommand
();
void
sendStopCommand
();
void
markCommandTimeout
(
Long
commandId
);
void
markCommandTimeout
(
Long
commandId
);
public
void
processPendingCommands
();
public
void
processPendingCommands
();
}
}
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/RobotArmCommandServiceImpl.java
View file @
7d7496aa
...
@@ -133,6 +133,30 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
...
@@ -133,6 +133,30 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
nettyUdpServerHandler
.
registerCommandExecution
(
address
,
command
.
getRobotArmCommandId
());
nettyUdpServerHandler
.
registerCommandExecution
(
address
,
command
.
getRobotArmCommandId
());
}
}
/**
* 发送归位指令
*/
@Override
public
void
sendHomeCommand
()
{
// 发送UDP指令
SocketAddress
address
=
getRobotAddress
();
udpCommandSender
.
sendCommandWithId
(
address
,
"HOME"
);
}
@Override
public
void
sendStopCommand
()
{
// 发送UDP指令
SocketAddress
address
=
getRobotAddress
();
udpCommandSender
.
sendCommandWithId
(
address
,
"STOP"
);
}
@Override
@Override
@Transactional
@Transactional
public
void
completeCommand
(
Long
commandId
)
{
public
void
completeCommand
(
Long
commandId
)
{
...
...
zhmes-agecal-web/src/api/robotArm/robotArmCommand.js
View file @
7d7496aa
...
@@ -35,6 +35,23 @@ export function insertBlankingRobotArmCommand(data) {
...
@@ -35,6 +35,23 @@ export function insertBlankingRobotArmCommand(data) {
})
})
}
}
// 发送归位指令
export
function
sendHomeCommand
()
{
return
request
({
url
:
'/robotArm/command/sendHomeCommand'
,
method
:
'get'
})
}
// 停止当前指令
export
function
sendStopCommand
()
{
return
request
({
url
:
'/robotArm/command/sendStopCommand'
,
method
:
'get'
})
}
// 执行上电操作
// 执行上电操作
export
function
powerOnCommand
(
commandId
)
{
export
function
powerOnCommand
(
commandId
)
{
...
...
zhmes-agecal-web/src/views/screen/components/AgingCabinetBoard.vue
View file @
7d7496aa
...
@@ -107,7 +107,7 @@ export default {
...
@@ -107,7 +107,7 @@ export default {
// 初始化WebSocket连接
// 初始化WebSocket连接
initWebSocket
()
{
initWebSocket
()
{
// 根据当前页面协议选择ws/wss
// 根据当前页面协议选择ws/wss
const
backendUrl
=
process
.
env
.
VUE_APP_API_BASE_URL
||
'http://localhost:808
0
'
;
const
backendUrl
=
process
.
env
.
VUE_APP_API_BASE_URL
||
'http://localhost:808
7
'
;
const
wsUrl
=
backendUrl
.
replace
(
'http'
,
'ws'
)
+
'/ws-aging-cabinet'
;
const
wsUrl
=
backendUrl
.
replace
(
'http'
,
'ws'
)
+
'/ws-aging-cabinet'
;
this
.
ws
=
new
WebSocket
(
wsUrl
);
this
.
ws
=
new
WebSocket
(
wsUrl
);
...
...
zhmes-agecal-web/src/views/screen/components/RoboticArm.vue
View file @
7d7496aa
...
@@ -21,6 +21,12 @@
...
@@ -21,6 +21,12 @@
<button
class=
"add-button"
@
click=
"showAddDialog = true"
>
<button
class=
"add-button"
@
click=
"showAddDialog = true"
>
<i
class=
"el-icon-plus"
></i>
上料
<i
class=
"el-icon-plus"
></i>
上料
</button>
</button>
<button
class=
"home-button"
@
click=
"handleHome"
>
<i
class=
"el-icon-refresh"
></i>
回零
</button>
<button
class=
"stop-button"
@
click=
"handleStop"
>
<i
class=
"el-icon-circle-close"
></i>
停止
</button>
</div>
</div>
</div>
</div>
...
@@ -146,7 +152,7 @@
...
@@ -146,7 +152,7 @@
<
script
>
<
script
>
import
{
addCommand
,
powerOnCommand
}
from
"@/api/robotArm/robotArmCommand"
import
{
addCommand
,
powerOnCommand
,
sendHomeCommand
,
sendStopCommand
}
from
"@/api/robotArm/robotArmCommand"
export
default
{
export
default
{
name
:
'RoboticArm'
,
name
:
'RoboticArm'
,
...
@@ -202,7 +208,7 @@ export default {
...
@@ -202,7 +208,7 @@ export default {
},
},
methods
:
{
methods
:
{
initWebSocket
()
{
initWebSocket
()
{
const
backendUrl
=
process
.
env
.
VUE_APP_API_BASE_URL
||
'http://localhost:808
0
'
;
const
backendUrl
=
process
.
env
.
VUE_APP_API_BASE_URL
||
'http://localhost:808
7
'
;
const
wsUrl
=
backendUrl
.
replace
(
'http'
,
'ws'
)
+
'/ws-robot-arm'
;
const
wsUrl
=
backendUrl
.
replace
(
'http'
,
'ws'
)
+
'/ws-robot-arm'
;
try
{
try
{
...
@@ -291,6 +297,20 @@ export default {
...
@@ -291,6 +297,20 @@ export default {
this
.
websocket
=
null
;
this
.
websocket
=
null
;
},
},
// 回零
handleHome
()
{
sendHomeCommand
().
then
(
response
=>
{
this
.
$message
.
success
(
"已发送"
);
})
},
// 停止
handleStop
()
{
sendStopCommand
().
then
(
response
=>
{
this
.
$message
.
success
(
"已发送"
);
})
},
closeDialog
()
{
closeDialog
()
{
this
.
showAddDialog
=
false
;
this
.
showAddDialog
=
false
;
},
},
...
@@ -471,7 +491,59 @@ export default {
...
@@ -471,7 +491,59 @@ export default {
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
}
}
/* 回零按钮样式 */
.home-button
{
background
:
linear-gradient
(
to
right
,
#67C23A
,
#85ce61
);
color
:
white
;
border
:
none
;
padding
:
8px
16px
;
border-radius
:
4px
;
cursor
:
pointer
;
font-size
:
14px
;
font-weight
:
bold
;
display
:
flex
;
align-items
:
center
;
box-shadow
:
0
2px
6px
rgba
(
0
,
0
,
0
,
0.3
);
transition
:
all
0.3s
;
margin-left
:
10px
;
/* 与其他按钮保持间距 */
}
.home-button
:hover
{
background
:
linear-gradient
(
to
right
,
#85ce61
,
#67C23A
);
transform
:
translateY
(
-2px
);
box-shadow
:
0
4px
8px
rgba
(
0
,
0
,
0
,
0.4
);
}
.home-button
i
{
margin-right
:
5px
;
}
/* 停止按钮样式 */
.stop-button
{
background
:
linear-gradient
(
to
right
,
#F56C6C
,
#f78989
);
color
:
white
;
border
:
none
;
padding
:
8px
16px
;
border-radius
:
4px
;
cursor
:
pointer
;
font-size
:
14px
;
font-weight
:
bold
;
display
:
flex
;
align-items
:
center
;
box-shadow
:
0
2px
6px
rgba
(
0
,
0
,
0
,
0.3
);
transition
:
all
0.3s
;
margin-left
:
10px
;
/* 与其他按钮保持间距 */
}
.stop-button
:hover
{
background
:
linear-gradient
(
to
right
,
#f78989
,
#F56C6C
);
transform
:
translateY
(
-2px
);
box-shadow
:
0
4px
8px
rgba
(
0
,
0
,
0
,
0.4
);
}
.stop-button
i
{
margin-right
:
5px
;
}
.add-button
{
.add-button
{
background
:
linear-gradient
(
to
right
,
#409EFF
,
#64c8ff
);
background
:
linear-gradient
(
to
right
,
#409EFF
,
#64c8ff
);
color
:
white
;
color
:
white
;
...
...
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