|
|
|
@ -6,18 +6,32 @@ import * as TWEEN from '@tweenjs/tween.js'
|
|
|
|
|
|
|
|
|
|
let timeOrSpeed = true
|
|
|
|
|
|
|
|
|
|
let isAGVAnimation = false
|
|
|
|
|
let AGVanimationLine = []
|
|
|
|
|
let isAGVAnimation = {
|
|
|
|
|
'2AGV': false,
|
|
|
|
|
'3AGV': false,
|
|
|
|
|
'5CCAGV': false,
|
|
|
|
|
'5BFAGV': false,
|
|
|
|
|
'5CTU': false
|
|
|
|
|
}
|
|
|
|
|
let AGVanimationLine = {
|
|
|
|
|
'2AGV': [],
|
|
|
|
|
'3AGV': [],
|
|
|
|
|
'5CCAGV': [],
|
|
|
|
|
'5BFAGV': [],
|
|
|
|
|
'5CTU': []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let animationEnum = ['2AGV', '3AGV', '5CCAGV', '5BFAGV', '5CTU']
|
|
|
|
|
|
|
|
|
|
const AGVanimation = async() => {
|
|
|
|
|
const AGVanimation = async(e) => {
|
|
|
|
|
try {
|
|
|
|
|
if (AGVanimationLine.length > 0) {
|
|
|
|
|
await AGVanimationLine[0]()
|
|
|
|
|
AGVanimationLine.shift()
|
|
|
|
|
if (AGVanimationLine.length > 0) {
|
|
|
|
|
AGVanimation(AGVanimationLine)
|
|
|
|
|
if (AGVanimationLine[e].length > 0) {
|
|
|
|
|
await AGVanimationLine[e][0]()
|
|
|
|
|
AGVanimationLine[e].shift()
|
|
|
|
|
if (AGVanimationLine[e].length > 0) {
|
|
|
|
|
AGVanimation(e)
|
|
|
|
|
} else {
|
|
|
|
|
isAGVAnimation = false
|
|
|
|
|
isAGVAnimation[e] = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
@ -26,14 +40,13 @@ const AGVanimation = async() => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function AGVanimate() {
|
|
|
|
|
if (AGVanimationLine.length > 0 && isAGVAnimation === false) {
|
|
|
|
|
isAGVAnimation = true
|
|
|
|
|
AGVanimation(AGVanimationLine)
|
|
|
|
|
}
|
|
|
|
|
animationEnum.forEach(e => {
|
|
|
|
|
if (AGVanimationLine[e].length > 0 && isAGVAnimation[e] === false) {
|
|
|
|
|
isAGVAnimation[e] = true
|
|
|
|
|
AGVanimation(e)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
requestAnimationFrame(AGVanimate)
|
|
|
|
|
TWEEN.update()
|
|
|
|
|
renderer.render(scene, camera)
|
|
|
|
|
labelRenderer.render(scene, camera)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AGVanimate()
|
|
|
|
@ -62,6 +75,7 @@ let agvData = {
|
|
|
|
|
rotate: 0
|
|
|
|
|
},
|
|
|
|
|
floor2AGVGroupLocation: {},
|
|
|
|
|
|
|
|
|
|
floor3AGVGroup: null,
|
|
|
|
|
floor3AGV: null,
|
|
|
|
|
floor3AGVData: {
|
|
|
|
@ -70,6 +84,7 @@ let agvData = {
|
|
|
|
|
rotate: 0
|
|
|
|
|
},
|
|
|
|
|
floor3AGVGroupLocation: {},
|
|
|
|
|
|
|
|
|
|
floor5CCAGVGroup: null,
|
|
|
|
|
floor5CCAGV: null,
|
|
|
|
|
floor5CCAGVGroupLocation: {},
|
|
|
|
@ -78,6 +93,7 @@ let agvData = {
|
|
|
|
|
y: 0,
|
|
|
|
|
rotate: 0
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
floor5BFAGVGroup: null,
|
|
|
|
|
floor5BFAGV: null,
|
|
|
|
|
floor5BFAGVGroupLocation: {},
|
|
|
|
@ -86,6 +102,7 @@ let agvData = {
|
|
|
|
|
y: 0,
|
|
|
|
|
rotate: 0
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
floor5CTUGroup: null,
|
|
|
|
|
floor5CTU: null,
|
|
|
|
|
floor5CTUGroupLocation: {},
|
|
|
|
@ -93,7 +110,7 @@ let agvData = {
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 0,
|
|
|
|
|
rotate: 0
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let loadAGVEnum = {
|
|
|
|
@ -101,46 +118,49 @@ let loadAGVEnum = {
|
|
|
|
|
'chacheshiAGV005': 'floor5CCAGV',
|
|
|
|
|
'CTU005': 'floor5CTU',
|
|
|
|
|
'chacheshiAGV002': 'floor2AGV',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGV',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGV'
|
|
|
|
|
}
|
|
|
|
|
let loadAGVGroupEnum = {
|
|
|
|
|
'beifushiAGV005': 'floor5BFAGVGroup',
|
|
|
|
|
'chacheshiAGV005': 'floor5CCAGVGroup',
|
|
|
|
|
'CTU005': 'floor5CTUGroup',
|
|
|
|
|
'chacheshiAGV002': 'floor2AGVGroup',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGVGroup',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGVGroup'
|
|
|
|
|
}
|
|
|
|
|
let LoadAGVDataEnum = {
|
|
|
|
|
'beifushiAGV005': 'floor5BFAGVData',
|
|
|
|
|
'chacheshiAGV005': 'floor5CCAGVData',
|
|
|
|
|
'CTU005': 'floor5CTUData',
|
|
|
|
|
'chacheshiAGV002': 'floor2AGVData',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGVData',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGVData'
|
|
|
|
|
}
|
|
|
|
|
let LoadAGVLocationEnum = {
|
|
|
|
|
'beifushiAGV005': 'floor5BFAGVGroupLocation',
|
|
|
|
|
'chacheshiAGV005': 'floor5CCAGVGroupLocation',
|
|
|
|
|
'CTU005': 'floor5CTUGroupLocation',
|
|
|
|
|
'chacheshiAGV002': 'floor2AGVGroupLocation',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGVGroupLocation',
|
|
|
|
|
'chacheshiAGV003': 'floor3AGVGroupLocation'
|
|
|
|
|
}
|
|
|
|
|
let axisEnum = {
|
|
|
|
|
'beifushiAGV005':{
|
|
|
|
|
z : 11.6
|
|
|
|
|
},
|
|
|
|
|
'chacheshiAGV002': {
|
|
|
|
|
// z : 11.6
|
|
|
|
|
x: 9,
|
|
|
|
|
z: 15
|
|
|
|
|
},
|
|
|
|
|
'chacheshiAGV003': {
|
|
|
|
|
// z : 11.6
|
|
|
|
|
x: 9,
|
|
|
|
|
z: 20.5
|
|
|
|
|
},
|
|
|
|
|
'beifushiAGV005': {
|
|
|
|
|
z: 11.6
|
|
|
|
|
},
|
|
|
|
|
'chacheshiAGV005': {
|
|
|
|
|
// z : 11.6
|
|
|
|
|
x: 9,
|
|
|
|
|
z: 22
|
|
|
|
|
},
|
|
|
|
|
'CTU005': {
|
|
|
|
|
x:-5,
|
|
|
|
|
z : -20
|
|
|
|
|
},
|
|
|
|
|
x: -3.5,
|
|
|
|
|
z: -20
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const loadAGV = (r) => {
|
|
|
|
|
r.forEach(e => {
|
|
|
|
@ -164,10 +184,9 @@ const loadAGV = (r) => {
|
|
|
|
|
axis.applyMatrix4(object.children[0].matrixWorld)
|
|
|
|
|
|
|
|
|
|
agvData[agvGroupName] = new THREE.Group()
|
|
|
|
|
console.log(object)
|
|
|
|
|
agvData[agvGroupName].add(object)
|
|
|
|
|
let axisDis = axisEnum[e]
|
|
|
|
|
Object.keys(axisDis || {}).forEach(v=>{
|
|
|
|
|
Object.keys(axisDis || {}).forEach(v => {
|
|
|
|
|
axis[v] += axisDis[v]
|
|
|
|
|
})
|
|
|
|
|
agvData[agvGroupName].position.set(axis.x, axis.y, axis.z)
|
|
|
|
@ -188,36 +207,36 @@ const loadAGV = (r) => {
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// loadAGV(['chacheshiAGV002','chacheshiAGV003','chacheshiAGV005','beifushiAGV005','CTU005'])
|
|
|
|
|
loadAGV(['CTU005'])
|
|
|
|
|
loadAGV(['chacheshiAGV002', 'chacheshiAGV003', 'chacheshiAGV005', 'beifushiAGV005', 'CTU005'])
|
|
|
|
|
// loadAGV(['chacheshiAGV003'])
|
|
|
|
|
|
|
|
|
|
let AGVGroupEnum = {
|
|
|
|
|
'5BFAGV': 'floor5BFAGVGroupLocation',
|
|
|
|
|
'5CCAGV': 'floor5CCAGVGroupLocation',
|
|
|
|
|
'5CTU': 'floor5CTUGroupLocation',
|
|
|
|
|
'2AGV': 'floor2AGVGroupLocation',
|
|
|
|
|
'3AGV': 'floor3AGVGroupLocation',
|
|
|
|
|
'3AGV': 'floor3AGVGroupLocation'
|
|
|
|
|
}
|
|
|
|
|
let AGVDataEnum = {
|
|
|
|
|
'5BFAGV': 'floor5BFAGVData',
|
|
|
|
|
'5CCAGV': 'floor5CCAGVData',
|
|
|
|
|
'5CTU': 'floor5CTUData',
|
|
|
|
|
'2AGV': 'floor2AGVData',
|
|
|
|
|
'3AGV': 'floor3AGVData',
|
|
|
|
|
'3AGV': 'floor3AGVData'
|
|
|
|
|
}
|
|
|
|
|
let groupEnum = {
|
|
|
|
|
'5BFAGV': 'floor5BFAGVGroup',
|
|
|
|
|
'5CCAGV': 'floor5CCAGVGroup',
|
|
|
|
|
'5CTU': 'floor5CTUGroup',
|
|
|
|
|
'2AGV': 'floor2AGVGroup',
|
|
|
|
|
'3AGV': 'floor3AGVGroup',
|
|
|
|
|
'3AGV': 'floor3AGVGroup'
|
|
|
|
|
}
|
|
|
|
|
let floorEnum = {
|
|
|
|
|
'5BFAGV': 'floor5Data',
|
|
|
|
|
'5CCAGV': 'floor5Data',
|
|
|
|
|
'5CTU': 'floor5Data',
|
|
|
|
|
'2AGV': 'floor2Data',
|
|
|
|
|
'3AGV': 'floor3Data',
|
|
|
|
|
'3AGV': 'floor3Data'
|
|
|
|
|
}
|
|
|
|
|
let rotateF = (e) => {
|
|
|
|
|
e %= 360
|
|
|
|
@ -233,10 +252,10 @@ let rotateF = (e) => {
|
|
|
|
|
const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
let s = 1
|
|
|
|
|
newLocation %= 360
|
|
|
|
|
if((item === '2AGV' || item === '3AGV'|| item === '5CCAGV') && type === 'rotate'){
|
|
|
|
|
if ((item === '2AGV' || item === '3AGV' || item === '5CCAGV') && type === 'rotate') {
|
|
|
|
|
newLocation -= 90
|
|
|
|
|
}
|
|
|
|
|
if((item === '5CTU' ) && type === 'rotate'){
|
|
|
|
|
if ((item === '5CTU') && type === 'rotate') {
|
|
|
|
|
newLocation += 90
|
|
|
|
|
}
|
|
|
|
|
let AGVGroupLocationData = AGVGroupEnum[item]
|
|
|
|
@ -256,41 +275,48 @@ const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
resolve()
|
|
|
|
|
}
|
|
|
|
|
let distance = location - agvData[AGVLocationData].x
|
|
|
|
|
|
|
|
|
|
let time1 = setInterval(() => {
|
|
|
|
|
if ((distance > 0 && agvData[group].position.x >= location) || (distance < 0 && agvData[group].position.x <= location)) {
|
|
|
|
|
const tween = new TWEEN.Tween(agvData[group].position)
|
|
|
|
|
.to({ x: location }, Math.abs(distance) / s * 16) // 移动到(1, 1, 1),持续1000毫秒
|
|
|
|
|
.onComplete(() => {
|
|
|
|
|
agvData[group].position.x = location
|
|
|
|
|
agvData[AGVLocationData].x = location
|
|
|
|
|
resolve()
|
|
|
|
|
clearInterval(time1)
|
|
|
|
|
clearTimeout(time3)
|
|
|
|
|
} else {
|
|
|
|
|
if (timeOrSpeed) {
|
|
|
|
|
if ((agvData[group].position.x - location) < 0) {
|
|
|
|
|
agvData[group].position.x += s
|
|
|
|
|
} else {
|
|
|
|
|
agvData[group].position.x -= s
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
agvData[group].position.x += distance / (time / 16)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
agvData[AGVLocationData].x = agvData[group].position.x
|
|
|
|
|
}
|
|
|
|
|
}, 16)
|
|
|
|
|
let intervalTime
|
|
|
|
|
if (timeOrSpeed) {
|
|
|
|
|
intervalTime = (distance / ((((agvData[group].position.x - location) < 0) ? 1 : -1) * s) * 16) + 1000
|
|
|
|
|
} else {
|
|
|
|
|
intervalTime = time + 1000
|
|
|
|
|
}
|
|
|
|
|
let time3 = setTimeout(() => {
|
|
|
|
|
agvData[group].position.x = location
|
|
|
|
|
agvData[AGVLocationData].x = location
|
|
|
|
|
resolve()
|
|
|
|
|
clearInterval(time1)
|
|
|
|
|
clearTimeout(time3)
|
|
|
|
|
}, intervalTime)
|
|
|
|
|
})
|
|
|
|
|
.start() // 立即开始动画
|
|
|
|
|
// let time1 = setInterval(() => {
|
|
|
|
|
// if ((distance > 0 && agvData[group].position.x >= location) || (distance < 0 && agvData[group].position.x <= location)) {
|
|
|
|
|
// agvData[group].position.x = location
|
|
|
|
|
// agvData[AGVLocationData].x = location
|
|
|
|
|
// resolve()
|
|
|
|
|
// clearInterval(time1)
|
|
|
|
|
// clearTimeout(time3)
|
|
|
|
|
// } else {
|
|
|
|
|
// if (timeOrSpeed) {
|
|
|
|
|
// if ((agvData[group].position.x - location) < 0) {
|
|
|
|
|
// agvData[group].position.x += s
|
|
|
|
|
// } else {
|
|
|
|
|
// agvData[group].position.x -= s
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// agvData[group].position.x += distance / (time / 16)
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// agvData[AGVLocationData].x = agvData[group].position.x
|
|
|
|
|
// }
|
|
|
|
|
// }, 16)
|
|
|
|
|
// let intervalTime
|
|
|
|
|
// if (timeOrSpeed) {
|
|
|
|
|
// intervalTime = (distance / ((((agvData[group].position.x - location) < 0) ? 1 : -1) * s) * 16) + 1000
|
|
|
|
|
// } else {
|
|
|
|
|
// intervalTime = time + 1000
|
|
|
|
|
// }
|
|
|
|
|
// let time3 = setTimeout(() => {
|
|
|
|
|
// agvData[group].position.x = location
|
|
|
|
|
// agvData[AGVLocationData].x = location
|
|
|
|
|
// resolve()
|
|
|
|
|
// clearInterval(time1)
|
|
|
|
|
// clearTimeout(time3)
|
|
|
|
|
// }, intervalTime)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
case 'z': {
|
|
|
|
@ -306,41 +332,49 @@ const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
}
|
|
|
|
|
let distance = location - agvData[AGVLocationData].z
|
|
|
|
|
|
|
|
|
|
let time1 = setInterval(() => {
|
|
|
|
|
if ((distance > 0 && agvData[group].position.z >= location) || (distance < 0 && agvData[group].position.z <= location)) {
|
|
|
|
|
const tween = new TWEEN.Tween(agvData[group].position)
|
|
|
|
|
.to({ z: location }, Math.abs(distance) / s * 16) // 移动到(1, 1, 1),持续1000毫秒
|
|
|
|
|
.onComplete(() => {
|
|
|
|
|
agvData[group].position.z = location
|
|
|
|
|
agvData[AGVLocationData].z = location
|
|
|
|
|
resolve()
|
|
|
|
|
clearInterval(time1)
|
|
|
|
|
clearTimeout(time3)
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if (timeOrSpeed) {
|
|
|
|
|
if ((agvData[group].position.z - location) < 0) {
|
|
|
|
|
agvData[group].position.z += s
|
|
|
|
|
} else {
|
|
|
|
|
agvData[group].position.z -= s
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
agvData[group].position.z += distance / (time / 16)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
agvData[AGVLocationData].z = agvData[group].position.z
|
|
|
|
|
}
|
|
|
|
|
}, 16)
|
|
|
|
|
let intervalTime
|
|
|
|
|
if (timeOrSpeed) {
|
|
|
|
|
intervalTime = (distance / ((((agvData[group].position.z - location) < 0) ? 1 : -1) * s) * 16) + 1000
|
|
|
|
|
} else {
|
|
|
|
|
intervalTime = time + 1000
|
|
|
|
|
}
|
|
|
|
|
let time3 = setTimeout(() => {
|
|
|
|
|
agvData[group].position.z = location
|
|
|
|
|
agvData[AGVLocationData].z = location
|
|
|
|
|
resolve()
|
|
|
|
|
clearInterval(time1)
|
|
|
|
|
clearTimeout(time3)
|
|
|
|
|
}, intervalTime)
|
|
|
|
|
})
|
|
|
|
|
.start()
|
|
|
|
|
// let time1 = setInterval(() => {
|
|
|
|
|
// if ((distance > 0 && agvData[group].position.z >= location) || (distance < 0 && agvData[group].position.z <= location)) {
|
|
|
|
|
// agvData[group].position.z = location
|
|
|
|
|
// agvData[AGVLocationData].z = location
|
|
|
|
|
// resolve()
|
|
|
|
|
// clearInterval(time1)
|
|
|
|
|
// clearTimeout(time3)
|
|
|
|
|
// } else {
|
|
|
|
|
//
|
|
|
|
|
// if (timeOrSpeed) {
|
|
|
|
|
// if ((agvData[group].position.z - location) < 0) {
|
|
|
|
|
// agvData[group].position.z += s
|
|
|
|
|
// } else {
|
|
|
|
|
// agvData[group].position.z -= s
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// agvData[group].position.z += distance / (time / 16)
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// agvData[AGVLocationData].z = agvData[group].position.z
|
|
|
|
|
// }
|
|
|
|
|
// }, 16)
|
|
|
|
|
// let intervalTime
|
|
|
|
|
// if (timeOrSpeed) {
|
|
|
|
|
// intervalTime = (distance / ((((agvData[group].position.z - location) < 0) ? 1 : -1) * s) * 16) + 1000
|
|
|
|
|
// } else {
|
|
|
|
|
// intervalTime = time + 1000
|
|
|
|
|
// }
|
|
|
|
|
// let time3 = setTimeout(() => {
|
|
|
|
|
// agvData[group].position.z = location
|
|
|
|
|
// agvData[AGVLocationData].z = location
|
|
|
|
|
// resolve()
|
|
|
|
|
// clearInterval(time1)
|
|
|
|
|
// clearTimeout(time3)
|
|
|
|
|
// }, intervalTime)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
case 'rotate': {
|
|
|
|
@ -354,23 +388,30 @@ const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
let endRotateNum = nowRotateNum + (distance * (Math.PI / 180))
|
|
|
|
|
let bool = (nowRotateNum - endRotateNum) > 0
|
|
|
|
|
|
|
|
|
|
let time1 = setInterval(() => {
|
|
|
|
|
if ((bool && nowRotateNum < endRotateNum) || (!bool && nowRotateNum > endRotateNum)) {
|
|
|
|
|
const tween = new TWEEN.Tween(agvData[group].rotation)
|
|
|
|
|
.to({ y: newLocation * (Math.PI / 180) }, 500) // 移动到(1, 1, 1),持续1000毫秒
|
|
|
|
|
.onComplete(() => {
|
|
|
|
|
agvData[group].rotation.y = (newLocation * (Math.PI / 180))
|
|
|
|
|
resolve()
|
|
|
|
|
clearInterval(time1)
|
|
|
|
|
clearTimeout(time2)
|
|
|
|
|
} else {
|
|
|
|
|
agvData[group].rotation.y += ((distance / (500 / 16)) * (Math.PI / 180))
|
|
|
|
|
nowRotateNum += ((distance / (500 / 16)) * (Math.PI / 180))
|
|
|
|
|
}
|
|
|
|
|
}, 16)
|
|
|
|
|
let time2 = setTimeout(() => {
|
|
|
|
|
agvData[group].rotation.y = (newLocation * (Math.PI / 180))
|
|
|
|
|
resolve()
|
|
|
|
|
clearInterval(time1)
|
|
|
|
|
clearTimeout(time2)
|
|
|
|
|
}, 500 + 1000)
|
|
|
|
|
})
|
|
|
|
|
.start()
|
|
|
|
|
// let time1 = setInterval(() => {
|
|
|
|
|
// if ((bool && nowRotateNum < endRotateNum) || (!bool && nowRotateNum > endRotateNum)) {
|
|
|
|
|
// agvData[group].rotation.y = (newLocation * (Math.PI / 180))
|
|
|
|
|
// resolve()
|
|
|
|
|
// clearInterval(time1)
|
|
|
|
|
// clearTimeout(time2)
|
|
|
|
|
// } else {
|
|
|
|
|
// agvData[group].rotation.y += ((distance / (500 / 16)) * (Math.PI / 180))
|
|
|
|
|
// nowRotateNum += ((distance / (500 / 16)) * (Math.PI / 180))
|
|
|
|
|
// }
|
|
|
|
|
// }, 16)
|
|
|
|
|
// let time2 = setTimeout(() => {
|
|
|
|
|
// agvData[group].rotation.y = (newLocation * (Math.PI / 180))
|
|
|
|
|
// resolve()
|
|
|
|
|
// clearInterval(time1)
|
|
|
|
|
// clearTimeout(time2)
|
|
|
|
|
// }, 500 + 1000)
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -382,82 +423,59 @@ const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const AGVAnimation = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
AGVanimationLine.push(() => AGVAnimationF(item, type, newLocation, time))
|
|
|
|
|
const AGVAnimation = (e, item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
if (agvData[groupEnum[e]] && AGVanimationLine[e].length < 10) {
|
|
|
|
|
AGVanimationLine[e].push(() => AGVAnimationF(item, type, newLocation, time))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
if (agvData.floor5BFAGVGroup) {
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
setTimeout(() =>{
|
|
|
|
|
let num1_1 = Math.random()
|
|
|
|
|
let num1_2 = Math.random()
|
|
|
|
|
let num1_3 = Math.random()
|
|
|
|
|
let num1_4 = Math.random()
|
|
|
|
|
let num1_5 = Math.random()
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
let num1 = Math.random()
|
|
|
|
|
// let num1 = 0.6
|
|
|
|
|
// let num1 = 0.4
|
|
|
|
|
if (num1 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5BFAGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5BFAGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
if (num1_1 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('2AGV', '2AGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('2AGV', '2AGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
let num1 = Math.random()
|
|
|
|
|
// let num1 = 0.6
|
|
|
|
|
// let num1 = 0.4
|
|
|
|
|
if (num1 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('3AGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('3AGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
let num1 = Math.random()
|
|
|
|
|
// let num1 = 0.6
|
|
|
|
|
// let num1 = 0.4
|
|
|
|
|
if (num1 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('2AGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('2AGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
let num1 = Math.random()
|
|
|
|
|
// let num1 = 0.6
|
|
|
|
|
// let num1 = 0.4
|
|
|
|
|
if (num1 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CCAGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CCAGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
},200000000)
|
|
|
|
|
if (num1_2 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('3AGV', '3AGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('3AGV', '3AGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (num1_3 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CCAGV', '5CCAGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CCAGV', '5CCAGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setTimeout(() =>{
|
|
|
|
|
if (num1_4 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5BFAGV', '5BFAGV', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5BFAGV', '5BFAGV', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
let num1 = Math.random()
|
|
|
|
|
// let num1 = 0.6
|
|
|
|
|
// let num1 = 0.4
|
|
|
|
|
if (num1 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CTU', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CTU', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
},20000000)
|
|
|
|
|
if (num1_5 > 0.5) {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CTU', '5CTU', 'x', num2)
|
|
|
|
|
} else {
|
|
|
|
|
let num2 = Math.random() * 100
|
|
|
|
|
AGVAnimation('5CTU', '5CTU', 'z', num2)
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
agvData,
|
|
|
|
|