diff --git a/Frontend/_sysMonFloor.html b/Frontend/_sysMonFloor.html index 737dc97..d05cade 100644 --- a/Frontend/_sysMonFloor.html +++ b/Frontend/_sysMonFloor.html @@ -31,10 +31,11 @@ var global_emergency_alarm_device_number = []; var zoomToggle = 3; var urn_all = "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6LW1pdHN1YmlzaGkvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU5JUExJUFGXzEyMjgubndk"; + var urn_test = "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8lRTUlOEQlOEElRTklODAlOEYlRTYlOTglOEUlRTUlQkIlQkElRTclQUYlODlfMTJfMzAubndk"; $(function () { getHotspotPoint(() => { - show3DModel(urn_all); + show3DModel(urn_test); }); initChart(); getFloData(); @@ -869,7 +870,7 @@ function show3DModel(urn) { launchViewerForHotspot(urn, (viewer, nodeIds) => { - getLevelsData(); + getLevelsData("7F", "8F");//剖面的下方樓層,剖面的上方樓層 loadHeatmapForFloor(); }); } diff --git a/Frontend/js/forge/forgemodel.js b/Frontend/js/forge/forgemodel.js index 7be0529..e57f1bb 100644 --- a/Frontend/js/forge/forgemodel.js +++ b/Frontend/js/forge/forgemodel.js @@ -6,6 +6,8 @@ var elevatorSpeed; var selector = "#forgeViewer"; let myDataList; var levels;//剖面用 +var lowerIdx;//剖面的下方樓層 +var upperIdx;//剖面的上方樓層 function launchViewer(urn, callback, _selector = "#forgeViewer") { selector = _selector; @@ -763,19 +765,19 @@ async function loadHeatmaps(model) { //取三個空調設備的位置打點 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"] @@ -837,28 +839,40 @@ async function loadHeatmapsForFloor(model) { const dataVizExtn = await viewer.loadExtension("Autodesk.DataVisualization"); + + //x: -17.33, y: 51.03, z: -2.52 + //var devices; 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"] } ]; + //myDataList.forEach((myData, index) => { + // //const dbId = 10 + index; + // //const myPosition = myData.position; + // //const viewable = new DataVizCore.SpriteViewable(myPosition, style, dbId); + // //myData._dbId = dbId; + // //viewableData.addViewable(viewable); + // devices.push(index, myData.position, ["temperature", "humidity"]); + //}); + // Initialize sensor values let sensorVals = []; for (let i = 0; i < devices.length; i++) { @@ -867,7 +881,7 @@ async function loadHeatmapsForFloor(model) { const roomDbIds = []; - roomDbIds.push(7567); + roomDbIds.push(11449); const { SurfaceShadingData, @@ -932,8 +946,17 @@ async function getRemoteLevels() { return levels2; } -async function getLevelsData() { +async function getLevelsData(lowerFloor, upperFloor) { + const data = await this.getRemoteLevels(); + for (var i = 0; i < data.length; i++) { + if ((data[i].name).indexOf(lowerFloor) != -1) { + lowerIdx = i; + } + if ((data[i].name).indexOf(upperFloor) != -1) { + upperIdx = i; + } + } this.levels = data; profile(); } @@ -957,9 +980,9 @@ function getCutPlaneParam(idx, n) { } function profile() { - const upperIdx = 6; + //const upperIdx = 6; const upperCutPlaneParam = this.getCutPlaneParam(upperIdx, 1); - const lowerIdx = 7; + //const lowerIdx = 7; const lowerCutPlaneParam = this.getCutPlaneParam(lowerIdx, -1); this.viewer.setCutPlanes([upperCutPlaneParam, lowerCutPlaneParam]); }