[Frontend] 測試功能,顯示tag_id相關資訊
This commit is contained in:
parent
dd8dfc4fe9
commit
8fe1dae9f7
@ -227,8 +227,14 @@
|
||||
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwTUVQJUUzJTgwJTkxXzIwMjJfMTJfMjkubndj');
|
||||
|
||||
//12.29 整棟
|
||||
launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6LW1pdHN1YmlzaGkvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU5JUExJUFGXzEyMjgubndk');
|
||||
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6LW1pdHN1YmlzaGkvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU5JUExJUFGXzEyMjgubndk');
|
||||
|
||||
//12.30 整棟樓 ARC + MEP
|
||||
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8xMl8zMC5ud2Q');
|
||||
|
||||
//12.30 整棟樓 ARC + MEP 半透明
|
||||
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8lRTUlOEQlOEElRTklODAlOEYlRTYlOTglOEUlRTUlQkIlQkElRTclQUYlODlfMTJfMzAubndk');
|
||||
launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8lRTUlOEQlOEElRTklODAlOEYlRTYlOTglOEUlRTUlQkIlQkElRTclQUYlODlfMTJfMzAubndk');
|
||||
|
||||
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwQVJDJUUzJTgwJTkxXzIwMjJfMTJfMTMubndk');//new ARC
|
||||
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwTUVQJUUzJTgwJTkxXzIwMjJfMTJfMTMubndj');//new MEP
|
||||
|
@ -172,7 +172,7 @@ function onDocumentLoadSuccess(doc) {
|
||||
const fragList = model.getFragmentList();
|
||||
|
||||
|
||||
/*loadHeatmaps(model);*/
|
||||
loadHeatmaps(model);
|
||||
|
||||
|
||||
|
||||
@ -270,11 +270,11 @@ function onDocumentLoadSuccess(doc) {
|
||||
e.properties.forEach(function (item) {
|
||||
if (item.displayName == "【tag_id】") { // Tag_name tag_id 【tag_id】
|
||||
if (item.displayValue != "") {
|
||||
//if ((item.displayValue).indexOf('TPE_B1_EE_E4') > -1) {
|
||||
if ((item.displayValue).indexOf('TPE_B1_ME_M10') > -1) {
|
||||
console.log("--------------------------------------------------");
|
||||
console.log("Tag_name dbid: " + e.dbId);
|
||||
console.log("value: " + item.displayValue);
|
||||
//}
|
||||
}
|
||||
//var v = getFragmentWorldMatrixByNodeId(e.dbId, viewer);
|
||||
//console.log("v: " + v);
|
||||
|
||||
@ -295,10 +295,10 @@ function onDocumentLoadSuccess(doc) {
|
||||
bounds.union(box);
|
||||
}, true);
|
||||
var position = bounds.center();
|
||||
//if ((item.displayValue).indexOf('TPE_B1_EE_E4') > -1) {
|
||||
if ((item.displayValue).indexOf('TPE_B1_ME_M10') > -1) {
|
||||
console.log("position: (" + (position.x).toFixed(2) + ", " + (position.y).toFixed(2) + ", " + (position.z).toFixed(2) + ")");
|
||||
console.log("--------------------------------------------------");
|
||||
//}
|
||||
}
|
||||
}
|
||||
//getFragmentWorldMatrixByNodeId(e.dbId, viewer);
|
||||
//let fragProxy = viewer.impl.getFragmentProxy(viewer.model, frag);
|
||||
@ -1067,19 +1067,19 @@ async function loadHeatmaps(model) {
|
||||
//x: -17.33, y: 51.03, z: -2.52
|
||||
const devices = [
|
||||
{
|
||||
id: "Oficina 5",
|
||||
id: "Oficina 3",
|
||||
//name: "Oficina-",
|
||||
position: { x: 6.98, y: -19.00, z: 16.86 }, // x: 0, y: 25, z: -2.5 (-4.93, -20.61, 16.86)
|
||||
sensorTypes: ["temperature", "humidity"]
|
||||
},
|
||||
{
|
||||
id: "Oficina 4",
|
||||
id: "Oficina 2",
|
||||
//name: "Oficina-",
|
||||
position: { x: 35.85, y: -2.24, z: 16.86 }, // x: 0, y: 25.03, z: -2.52 (23.94, -3.85, 16.86)
|
||||
sensorTypes: ["temperature", "humidity"]
|
||||
},
|
||||
{
|
||||
id: "Oficina 3",
|
||||
id: "Oficina 1",
|
||||
//name: "Oficina-",
|
||||
position: { x: 6.98, y: -2.24, z: 16.86 }, // x: 0, y: 25.03, z: -2.52 (-4.93, -3.85, 16.86)
|
||||
sensorTypes: ["temperature", "humidity"]
|
||||
@ -1130,7 +1130,7 @@ async function loadHeatmaps(model) {
|
||||
// },
|
||||
// true
|
||||
//);
|
||||
roomDbIds.push(7567);//5113 834 838 8106 8177 792 8181
|
||||
roomDbIds.push(11449);//5113 834 838 8106 8177 792 8181 7567
|
||||
//roomDbIds.push(8183);
|
||||
//roomDbIds.push(8185);
|
||||
|
||||
@ -1166,9 +1166,11 @@ async function loadHeatmaps(model) {
|
||||
dataVizExtn.registerSurfaceShadingColors("temperature", [0xff0000, 0x0000ff]);
|
||||
|
||||
function getSensorValue(device, sensorType) {
|
||||
return sensorVals[parseInt(device.id.slice(-1)) - 1];
|
||||
return sensorVals[parseInt(device.id.slice(-1)) - 1]; // 值: 0~1之間
|
||||
//return 0;
|
||||
}
|
||||
|
||||
|
||||
dataVizExtn.renderSurfaceShading("Room Panel", "temperature", getSensorValue);
|
||||
|
||||
setInterval(() => {
|
||||
@ -1336,7 +1338,7 @@ async function test() {
|
||||
|
||||
if (material) {
|
||||
//设置透明度
|
||||
material.opacity = 0.5;
|
||||
material.opacity = 0;
|
||||
material.transparent = true;
|
||||
//标记更新
|
||||
material.needsUpdate = true
|
||||
|
Loading…
Reference in New Issue
Block a user