修改agv动画

master
夜笙歌 3 months ago
parent 12b8c4a439
commit c82747aded

@ -454,19 +454,11 @@ const AGVAnimation = (e, item, type, newLocation = {}, time = 2000) => {
} }
} }
setInterval(() => {
if (isLoading) {
AGVAnimation('2AGV', '2AGV', 'xz', { x: Math.random() * 100, z: Math.random() * 100 })
AGVAnimation('3AGV', '3AGV', 'xz', { x: Math.random() * 100, z: Math.random() * 100 })
AGVAnimation('5CCAGV', '5CCAGV', 'xz', { x: Math.random() * 100, z: Math.random() * 100 })
AGVAnimation('5BFAGV', '5BFAGV', 'xz', { x: Math.random() * 100, z: Math.random() * 100 })
AGVAnimation('5CTU', '5CTU', 'x', { x: (7 + Math.random() * 70) })
}
}, 2500)
export { export {
agvData, agvData,
AGVAnimation AGVAnimation,
floorOrigin,
floorData1,
isAGVLoading
} }

@ -112,11 +112,11 @@ import {
storeyHeight, storeyHeight,
storeyWidth, storeyWidth,
tuopanLocation, tuopanLocation,
animationLine animationLine, isLoading
} from './setThree' } from './setThree'
import { import {
AGVAnimation, agvData AGVAnimation, agvData,floorOrigin,floorData1,isAGVLoading
} from './agv' } from './agv'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
@ -134,9 +134,42 @@ export default {
} }
}, },
mounted() { mounted() {
getAgvDeviceStatus().then(e=>{ setInterval(()=>{
console.log(e) if(isLoading && isAGVLoading){
}) getAgvDeviceStatus().then(e=>{
console.log(e)
e.data.agvStatusList.forEach(v=>{
if(v.agvName === "2楼叉车"){
let x = (v.posX - floorOrigin.floor2Data.x) / floorData1.floor2Data.x
let z = (v.posY - floorOrigin.floor2Data.y) / floorData1.floor2Data.z
console.log({x,z})
AGVAnimation('2AGV', '2AGV', 'xz', { x: x * 100, z: z * 100 })
}
if(v.agvName === "3楼叉车"){
let x = (v.posX - floorOrigin.floor3Data.x) / floorData1.floor3Data.x
let z = (v.posY - floorOrigin.floor3Data.y) / floorData1.floor3Data.z
AGVAnimation('3AGV', '3AGV', 'xz', { x: x * 100, z: z * 100 })
}
if(v.agvName === "5楼叉车"){
let x = (v.posX - floorOrigin.floor5Data.x) / floorData1.floor5Data.x
let z = (v.posY - floorOrigin.floor5Data.y) / floorData1.floor5Data.z
AGVAnimation('5CCAGV', '5CCAGV', 'xz', { x: x * 100, z: z * 100 })
}
if(v.agvName === "5楼背负式"){
let x = (v.posX - floorOrigin.floor5Data.x) / floorData1.floor5Data.x
let z = (v.posY - floorOrigin.floor5Data.y) / floorData1.floor5Data.z
AGVAnimation('5BFAGV', '5BFAGV', 'xz', { x: x * 100, z: z * 100 })
}
if(v.agvName === "5楼CTU"){
let x = (v.posX - floorOrigin.floor5Data.x) / floorData1.floor5Data.x
let z = (v.posY - floorOrigin.floor5Data.y) / floorData1.floor5Data.z
AGVAnimation('5CTU', '5CTU', 'x', { x: x * 100, z: z * 100 })
}
})
})
}
},2500)
this.$refs.threeJs.appendChild(renderer.domElement) this.$refs.threeJs.appendChild(renderer.domElement)
// controls.rotateSpeed = -controls.rotateSpeed; // controls.rotateSpeed = -controls.rotateSpeed;

Loading…
Cancel
Save