|
|
|
@ -90,59 +90,59 @@ export default class LCCScript implements LCC { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
queryDeviceInfoList(): Promise<ServerResponse<DeviceVo[]>> { |
|
|
|
queryDeviceInfoList(): Promise<ServerResponse<AgvStatusVo[]>> { |
|
|
|
return Request.request.post('/api/workbench/LccController@queryDeviceInfoList', { |
|
|
|
projectUUID: worldModel.state.project_uuid, |
|
|
|
envId: worldModel.state.runState.currentEnvId |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 从后台读取所有车
|
|
|
|
async loadExecutor(): Promise<ExecutorVo> { |
|
|
|
const res = await Request.request.post('/api/workbench/LccController@loadExecutor', { |
|
|
|
projectUuid: worldModel.state.project_uuid, |
|
|
|
envId: worldModel.state.runState.currentEnvId |
|
|
|
}) |
|
|
|
|
|
|
|
for (const row of res.data) { |
|
|
|
const executor_id = row.executor_id |
|
|
|
const payload = JSON.parse(row.virtual_executor_payload) |
|
|
|
// 车所在的标记位置,及方向 11_4:RIGHT
|
|
|
|
const [wayPointId, direction] = _.split(row.virtual_location_at, ':') |
|
|
|
|
|
|
|
if (window['Model']) { |
|
|
|
const point = Model.find(wayPointId) |
|
|
|
if (!point) { |
|
|
|
console.error(`Waypoint with ID ${wayPointId} not found for executor ${executor_id}.`) |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|
const item = _.cloneDeep(payload) |
|
|
|
item.id = executor_id |
|
|
|
item.tf[0] = _.cloneDeep(point.tf[0]) |
|
|
|
switch (_.toLower(direction)) { |
|
|
|
// right=0/left=180/up=90/down=-90
|
|
|
|
case 'right': |
|
|
|
item.tf[1][1] = 0 // 右侧
|
|
|
|
break |
|
|
|
case 'left': |
|
|
|
item.tf[1][1] = 180 // 左侧
|
|
|
|
break |
|
|
|
case 'down': |
|
|
|
item.tf[1][1] = -90 // 下方
|
|
|
|
break |
|
|
|
case 'up': |
|
|
|
item.tf[1][1] = 90 // 上方
|
|
|
|
break |
|
|
|
} |
|
|
|
if (row.virtual_floor_code === worldModel.state.catalogCode) { |
|
|
|
Model.createExecutor(item) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return res.data |
|
|
|
} |
|
|
|
// // 从后台读取所有车
|
|
|
|
// async loadExecutor(): Promise<ExecutorVo> {
|
|
|
|
// const res = await Request.request.post('/api/workbench/LccController@loadExecutor', {
|
|
|
|
// projectUuid: worldModel.state.project_uuid,
|
|
|
|
// envId: worldModel.state.runState.currentEnvId
|
|
|
|
// })
|
|
|
|
//
|
|
|
|
// for (const row of res.data) {
|
|
|
|
// const executor_id = row.executor_id
|
|
|
|
// const payload = JSON.parse(row.virtual_executor_payload)
|
|
|
|
// // 车所在的标记位置,及方向 11_4:RIGHT
|
|
|
|
// const [wayPointId, direction] = _.split(row.virtual_location_at, ':')
|
|
|
|
//
|
|
|
|
// if (window['Model']) {
|
|
|
|
// const point = Model.find(wayPointId)
|
|
|
|
// if (!point) {
|
|
|
|
// console.error(`Waypoint with ID ${wayPointId} not found for executor ${executor_id}.`)
|
|
|
|
// continue
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// const item = _.cloneDeep(payload)
|
|
|
|
// item.id = executor_id
|
|
|
|
// item.tf[0] = _.cloneDeep(point.tf[0])
|
|
|
|
// switch (_.toLower(direction)) {
|
|
|
|
// // right=0/left=180/up=90/down=-90
|
|
|
|
// case 'right':
|
|
|
|
// item.tf[1][1] = 0 // 右侧
|
|
|
|
// break
|
|
|
|
// case 'left':
|
|
|
|
// item.tf[1][1] = 180 // 左侧
|
|
|
|
// break
|
|
|
|
// case 'down':
|
|
|
|
// item.tf[1][1] = -90 // 下方
|
|
|
|
// break
|
|
|
|
// case 'up':
|
|
|
|
// item.tf[1][1] = 90 // 上方
|
|
|
|
// break
|
|
|
|
// }
|
|
|
|
// if (row.virtual_floor_code === worldModel.state.catalogCode) {
|
|
|
|
// Model.createExecutor(item)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// return res.data
|
|
|
|
// }
|
|
|
|
|
|
|
|
/** |
|
|
|
* 脚本打印日志 |
|
|
|
|