|
@@ -26,6 +26,7 @@ let textureOffline = textureLoader.load('../images/location_offline.png');
|
|
|
window.benchMeshMap = {};
|
|
|
window.benchMeshWaterMap = {};
|
|
|
window.benchDBList = null
|
|
|
+window.benchPosList = [];
|
|
|
|
|
|
function getsqlData(sdkInstance, uwbInstance, bAddModel) {
|
|
|
let g_PosArrayResult = null;
|
|
@@ -468,12 +469,12 @@ function getsqlData(sdkInstance, uwbInstance, bAddModel) {
|
|
|
if (window.uwbInstance)
|
|
|
{
|
|
|
clearInterval(window.otherInterval)
|
|
|
- var benchPosList = [];
|
|
|
+ //var benchPosList = [];
|
|
|
for (var item of result) {
|
|
|
var localPosition = new THREE.Vector3(item.fix_pos_x, item.fix_pos_y, item.fix_pos_z);
|
|
|
var worldPosition = window.uwbInstance.convertLocalToWorld(localPosition);
|
|
|
var pos = window.sdkInstance.getScreenPosition(worldPosition);
|
|
|
- benchPosList.push(
|
|
|
+ window.benchPosList.push(
|
|
|
{
|
|
|
x: pos.x,
|
|
|
y: pos.y,
|
|
@@ -483,8 +484,8 @@ function getsqlData(sdkInstance, uwbInstance, bAddModel) {
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
- console.log('benchPosList',benchPosList)
|
|
|
- window.showBenchPos(benchPosList);
|
|
|
+ console.log('benchPosList',window.benchPosList)
|
|
|
+ window.showBenchPos(window.benchPosList);
|
|
|
setInterval(()=>{
|
|
|
getsqlDataRealTime();
|
|
|
},60*1000)
|
|
@@ -516,7 +517,7 @@ function getsqlDataRealTime() {
|
|
|
// 触发事件进行从服务器获取数据
|
|
|
window.vm.$socket.emit("REPT", msg, (datas) => {
|
|
|
let result = datas.data;
|
|
|
- var benchPosList = [];
|
|
|
+ //var benchPosList = [];
|
|
|
for (var item of result) {
|
|
|
let x = item.x;
|
|
|
let y = item.y;
|
|
@@ -597,19 +598,21 @@ function getsqlDataRealTime() {
|
|
|
var localPosition = new THREE.Vector3(window.benchMeshMap[item.bench_id].position.x,window.benchMeshMap[item.bench_id].position.y,window.benchMeshMap[item.bench_id].position.z);
|
|
|
var worldPosition = window.uwbInstance.convertLocalToWorld(localPosition);
|
|
|
var pos = window.sdkInstance.getScreenPosition(worldPosition);
|
|
|
- benchPosList.push(
|
|
|
+ window.benchPosList.forEach(function(element)
|
|
|
+ {
|
|
|
+ if(element.benchId == item.bench_id)
|
|
|
{
|
|
|
- x: pos.x,
|
|
|
- y: pos.y,
|
|
|
- benchType: item.bench_type,
|
|
|
- benchId: item.bench_id,
|
|
|
- benchImg: item.bench_img,
|
|
|
+ element.x = pos.x
|
|
|
+ element.y = pos.y
|
|
|
+ element.benchType = item.bench_type
|
|
|
+ element.benchId = item.bench_id
|
|
|
+ element.benchImg = item.bench_img
|
|
|
}
|
|
|
- )
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- console.log('benchPosList', benchPosList)
|
|
|
- window.showBenchPos(benchPosList);
|
|
|
+ console.log('benchPosList', window.benchPosList)
|
|
|
+ window.showBenchPos(window.benchPosList);
|
|
|
});
|
|
|
}
|
|
|
|