init: 路桥一把手孪生 大屏看板 项目首次入库

This commit is contained in:
XingCheng3
2026-05-29 14:50:51 +08:00
commit 6aa246f110
365 changed files with 89222 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
let ObjectNames
let Values
let Dir
let ModelRotateWorker
let AnimObjectArray
let ModelMotionAttributeWorker
let RotationValue
let RotateSpeed
let Direction = 1
onmessage = function (e) {
ObjectNames = e.data.ObjectNames
Values = e.data.Values
Dir = e.data.Dir
ModelRotateWorker = e.data.ModelRotateWorker
RotationValue = e.data.RotationValue
RotateSpeed = e.data.RotateSpeed
modelRotationWorker(e.data.ObjectNames, e.data.Dir, e.data.Values, e.data.RotationValue)
}
function modelRotationWorker(objectNames, Dir, Values, rotationValue) {
let m = ModelRotateWorker
Dir = parseInt(Dir)
if (m.state === Dir) return
if (Dir === 0) {
m.doAnimation = false
m.state = 0
self.close();
clearInterval(m.myVarSetInterval)
} else {
clearInterval(m.myVarSetInterval)
m.state = Dir
if (Dir === 1) {
Direction = Values / Math.abs(Values)
m.doAnimation = true
m.myVarSetInterval = setInterval(()=> {
if(m.state === 1){
rotationValue += RotateSpeed * Direction
self.postMessage({
objectNames: objectNames,
rotation: rotationValue
})
} else {
clearInterval(m.myVarSetInterval)
// Worker 线程结束
self.close();
m.doAnimation = false
}
},500 / (3 * Math.abs(Values)))
}
}
}