| | |
| | | </view> |
| | | <view class="content" v-show="opSceneType =='scan'"> |
| | | <view class="fabric" :message="ctxDataStr" :change:message="ctx.receiveMsg" id="canvasMap"></view> |
| | | <view class="position" @click="clickVehiclePosition"> |
| | | <text class="ico my-location-rounded"></text> |
| | | </view> |
| | | </view> |
| | | <view class="bottom"> |
| | | <view class="bottom-content" v-if="opSceneType =='add_name' "> |
| | |
| | | showToast, |
| | | showModal, |
| | | session, |
| | | showError, |
| | | showInfo |
| | | } from "@/comm/utils.js" |
| | | import { |
| | | Button |
| | |
| | | showClearName: false, |
| | | mapId: "", |
| | | ctxDataStr: "[]", |
| | | localSceneList: [] |
| | | localSceneList: [], |
| | | positioningAgv: true, |
| | | robotPos: {} |
| | | |
| | | } |
| | | }, |
| | |
| | | }) |
| | | return true |
| | | |
| | | } else if (this.opSceneType == "finish") { |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('create_finish', this.sceneName); |
| | | return false |
| | | } else { |
| | | return false |
| | | } |
| | |
| | | |
| | | } catch (ex) { |
| | | |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | receiveRenderData(param) { |
| | |
| | | }) |
| | | } |
| | | |
| | | } else if (param.method == "cancel_positioning_agv") { |
| | | this.positioningAgv = false |
| | | } |
| | | }, |
| | | |
| | |
| | | const list = session.getValue("scene_db") || [] |
| | | return list |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return [] |
| | | } |
| | | }, |
| | |
| | | delta: 1, //返回层数,2则上上页 |
| | | }) |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } finally { |
| | | this.loading = false |
| | | uni.hideLoading() |
| | |
| | | |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | this.opSceneType = 'add_name' |
| | | } finally { |
| | | this.loading = false |
| | |
| | | title: "结束场景构建" |
| | | }) |
| | | this.opSceneType = "" |
| | | await createScene(this.ip, this.sceneName, 0) |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('create_finish', this.sceneName); |
| | | uni.navigateBack({ |
| | |
| | | const info = await getMapLaserData(this.ip, this.mapId) |
| | | return info |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return {} |
| | | } |
| | | }, |
| | |
| | | |
| | | const listCtrData = [] |
| | | if (data.base_map?.image_base64) { |
| | | |
| | | this.robotPos = {} |
| | | this.mapId = data.base_map.map_id |
| | | listCtrData.push({ |
| | | method: "background", |
| | |
| | | filedata: data.base_map.image_base64 |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | listCtrData.push({ |
| | | method: "agv_laser", |
| | | param: data.robot_pose |
| | | }) |
| | | listCtrData.push({ |
| | | method: "point_cloud", |
| | | param: data.point_cloud |
| | | }) |
| | | if (this.positioningAgv) { |
| | | listCtrData.push({ |
| | | method: "agv_laser", |
| | | param: data.robot_pose |
| | | }) |
| | | listCtrData.push({ |
| | | method: "point_cloud", |
| | | param: data.point_cloud |
| | | }) |
| | | listCtrData.push({ |
| | | method: "move_canvas", |
| | | method: "move_pt_visible", |
| | | param: { |
| | | x: data.robot_pose.x, |
| | | y: data.robot_pose.y |
| | | y: data.robot_pose.y, |
| | | width:50, |
| | | height:50, |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | listCtrData.push({ |
| | | method: "agv_laser", |
| | | param: data.robot_pose |
| | | }) |
| | | listCtrData.push({ |
| | | method: "point_cloud", |
| | | param: data.point_cloud |
| | | }) |
| | | } |
| | | |
| | | this.ctxDataStr = JSON.stringify(listCtrData) |
| | | this.robotPos = { |
| | | x: data.robot_pose.x, |
| | | y: data.robot_pose.y |
| | | } |
| | | } |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | } finally { |
| | | // 无论成功失败,1 秒后再来 |
| | | setTimeout(this.refreshMapLaserData, 1000); |
| | | } catch (ex) { |
| | | showError(ex).then((res) => { |
| | | setTimeout(this.refreshMapLaserData, 1000); |
| | | }) |
| | | } |
| | | }, |
| | | async clickVehiclePosition() { |
| | | this.positioningAgv = true |
| | | |
| | | showError(ex) { |
| | | console.log(ex) |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.msg == "string" ? ex.msg : exStr |
| | | showModal(tip, "错误", false, "确定") |
| | | if (this.robotPos.x) { |
| | | this.ctxDataStr = JSON.stringify([{ |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: this.robotPos.x, |
| | | y: this.robotPos.y |
| | | } |
| | | }]) |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | |
| | |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .position { |
| | | position: absolute; |
| | | right: 50rpx; |
| | | bottom: 500rpx; |
| | | |
| | | .ico { |
| | | font-size: 65rpx; |
| | | color: #1890FF; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |