Compare commits

...

2 Commits

  1. 1
      src/core/manager/EnvManager.ts
  2. 17
      src/modules/amr/ptr/PtrObject.ts
  3. 208
      src/views/taskManagement/automatedPresentation.vue

1
src/core/manager/EnvManager.ts

@ -200,6 +200,7 @@ export default class EnvManager {
}
item.id = getAgvItemNameById(agvState.id)
item.dt.vehicleId = agvState.id
Model.createExecutor(item)
}
}

17
src/modules/amr/ptr/PtrObject.ts

@ -377,6 +377,10 @@ export default class PtrObject extends THREE.Object3D {
}
subscribeMessage(topic: string) {
if (!worldModel.envManager.client) {
console.warn('worldModel.envManager.client is null!')
return
}
worldModel.envManager.client.subscribe(topic, { qos: 0 })
}
@ -391,6 +395,11 @@ export default class PtrObject extends THREE.Object3D {
if (this.sendMessageQueue.length <= 0) {
this.mqRetryTimeCount = 0
}
if (!worldModel.envManager.client) {
console.warn('worldModel.envManager.client is null!')
this.heartBeatTimeCount = 0
return
}
worldModel.envManager.client.publish('/agv_robot/status', JSON.stringify(msg))
this.heartBeatTimeCount = 0
}
@ -402,6 +411,10 @@ export default class PtrObject extends THREE.Object3D {
const content = new AmrMsg20100(this.vehicleId)
content.Temperature = { Battery: this.Battery }
const m20100 = new AmrMsg<AmrMsg20100>(content)
if (!worldModel.envManager.client) {
console.warn('worldModel.envManager.client is null!')
return
}
worldModel.envManager.client.publish('/agv_robot/status', JSON.stringify(m20100))
}
@ -412,6 +425,10 @@ export default class PtrObject extends THREE.Object3D {
const msg20050 = new AmrMsg20050(seqNo, vehicleId)
const ack = new AmrMsg<AmrMsg20050>(msg20050)
this.heartBeatTimeCount = 0
if (!worldModel.envManager.client) {
console.warn('worldModel.envManager.client is null!')
return
}
worldModel.envManager.client.publish('/agv_robot/status', JSON.stringify(ack))
}

208
src/views/taskManagement/automatedPresentation.vue

@ -1,21 +1,221 @@
<template>
<div class="modeling-simulation">
<!--
<iframe class="galaxis-ai" style="width: 100%;height: 100%;border: none;" src="https://180.100.199.56:8656/#/chat"></iframe>
我需要2列每列4个按钮. 分别功能是
CL2 开始演示
/api/workbench/ApiController@demo_start
{
"car_no": "cl2"
}
CL2 停止演示
/api/workbench/ApiController@demo_stop
{
"car_no": "cl2"
}
CL2 入库请求
/api/workbench/ApiController@in_bound
CL2 出库请求
/api/workbench/ApiController@out_bound
---
CLX 开始演示
/api/workbench/ApiController@demo_start
{
"car_no": "clx"
}
CLX 停止演示
/api/workbench/ApiController@demo_stop
{
"car_no": "clx"
}
CLX 呼叫礼品托盘
/api/workbench/ApiController@gift_slot
CLX 礼品回库
/api/workbench/ApiController@gift_back
-->
<el-card>
<el-row>
<el-col :span="6">
<el-row class="each-row">
<el-button @click="clxDemoStart" type="primary" :icon="renderIcon('Play')">CLX 开始演示</el-button>
</el-row>
<el-row class="each-row">
<el-button @click="clxDemoStop" plain type="warning" :icon="renderIcon('Stop')">CLX 停止演示</el-button>
</el-row>
<el-row class="each-row">
<el-button @click="clxGiftSlot">CLX 呼叫礼品托盘</el-button>
</el-row>
<el-row class="each-row">
<el-button @click="clxGiftBack">CLX 礼品回库</el-button>
</el-row>
</el-col>
<el-col :span="6">
<el-row class="each-row">
<el-button @click="cl2DemoStart" type="primary" :icon="renderIcon('Play')">CL2 开始演示</el-button>
</el-row>
<el-row class="each-row">
<el-button @click="cl2DemoStop" type="warning" plain :icon="renderIcon('Stop')">CL2 停止演示</el-button>
</el-row>
<el-row class="each-row">
<el-button @click="cl2InBound">CL2 入库请求</el-button>
</el-row>
<el-row class="each-row">
<el-button @click="cl2OutBound">CL2 出库请求</el-button>
</el-row>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script setup lang="ts">
import { onMounted, onUnmounted } from "vue";
import { renderIcon } from '@/utils/webutils.ts'
import { onMounted, onUnmounted } from 'vue'
import { Request } from '@ease-forge/shared'
function mes(event: MessageEvent) {
console.log('data', event.data);
console.log('data', event.data)
}
function cl2DemoStart() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@demo_start',
{
'car_no': 'cl2'
}
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
function cl2DemoStop() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@demo_stop',
{
'car_no': 'cl2'
}
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
function cl2InBound() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@in_bound',
{
'car_no': 'cl2'
}
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
function cl2OutBound() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@out_bound',
{
'car_no': 'cl2'
}
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
function clxDemoStart() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@demo_start',
{
'car_no': 'clx'
}
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
function clxDemoStop() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@demo_stop',
{
'car_no': 'clx'
}
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
onMounted(() => window.addEventListener('message', mes));
onUnmounted(() => window.removeEventListener('message', mes));
function clxGiftSlot() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@gift_slot'
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
function clxGiftBack() {
system.showLoading()
Request.request.post(
'/api/workbench/ApiController@gift_back'
).then((res) => {
if (res.success) {
system.showInfoDialog(res.msg)
}
}).finally(() => {
system.clearLoading()
})
}
onMounted(() => window.addEventListener('message', mes))
onUnmounted(() => window.removeEventListener('message', mes))
</script>
<style lang="less">
.modeling-simulation {
width: 100%;
height: 100%;
}
.each-row {
margin-bottom: 10px;
}
</style>

Loading…
Cancel
Save