From 7ac664683bf5887c921a2e5e60b64b93d979ce19 Mon Sep 17 00:00:00 2001 From: wanli Date: Fri, 30 Dec 2022 18:24:19 +0800 Subject: [PATCH 1/8] =?UTF-8?q?[Frontend]=20=E5=89=96=E9=9D=A2=E6=A1=86=20?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_sysMonFloor.html | 5 ++-- Frontend/js/forge/forgemodel.js | 43 +++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 12 deletions(-) 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 34ed5a5..42b30f6 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]); } From 79ebe8714290437d3c0b483122fb4973c99cacc0 Mon Sep 17 00:00:00 2001 From: dev01 Date: Fri, 30 Dec 2022 18:27:02 +0800 Subject: [PATCH 2/8] =?UTF-8?q?[Frontend][forge]=20=E7=86=B1=E5=9C=96?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/js/forge/forgemodel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frontend/js/forge/forgemodel.js b/Frontend/js/forge/forgemodel.js index 34ed5a5..7be0529 100644 --- a/Frontend/js/forge/forgemodel.js +++ b/Frontend/js/forge/forgemodel.js @@ -315,7 +315,7 @@ function getNodeIdByDbIds(allDbIdsStr, callback = null) { let _childId = 0; let evelMap = new Map(); let finTimeout = null; - let fin2Timeout = null; + let fin2Timeout = null; let hasElec = false; allDbIdsStr.forEach((dbId) => { From 7db899884bee3076efb160bd79573bf77f4b4554 Mon Sep 17 00:00:00 2001 From: dev01 Date: Fri, 30 Dec 2022 19:03:31 +0800 Subject: [PATCH 3/8] =?UTF-8?q?[Frontend][=E7=B3=BB=E7=B5=B1=E7=9B=A3?= =?UTF-8?q?=E6=8E=A7]=20=E5=B9=B3=E9=9D=A2=E5=9C=96=20baja=20=E8=A1=9D?= =?UTF-8?q?=E7=AA=81=E5=95=8F=E9=A1=8C=E8=A7=A3=E6=B1=BA=20|=20=E5=B9=B3?= =?UTF-8?q?=E9=9D=A2=E5=9C=96=E5=89=96=E9=9D=A2=E6=A1=86=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E4=B8=B2=E6=8E=A5=20|=20=E7=86=B1=E9=BB=9E=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E4=B8=B2=E6=8E=A5=20|=20[=E5=85=A8=E5=9F=9F=E5=8A=9F=E8=83=BD]?= =?UTF-8?q?=20=E7=86=B1=E5=9C=96=E6=BA=AB=E5=BA=A6=E7=89=A9=E4=BB=B6?= =?UTF-8?q?=E5=8C=96=E7=A8=8B=E5=BA=8F=E8=AA=BF=E6=95=B4=20|=20=E5=8F=96?= =?UTF-8?q?=E5=BE=97=20node=20Id=20by=20tag=20id=20=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=84=AA=E5=8C=96=20|=20[FrontendWebApi]=20GetForgeNodeName=20?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E8=B3=87=E6=96=99=E5=BA=AB=20variable=20?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=20forge=20=E4=BE=9D=E6=93=9A=E5=AD=97?= =?UTF-8?q?=E4=B8=B2=E7=A8=8B=E5=BA=8F=E5=BB=BA=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_sysMonAll.html | 21 +- Frontend/_sysMonFloor.html | 15 +- Frontend/js/forge/forgemodel.js | 229 +++++++++--------- .../ApiControllers/DeviceManageController.cs | 38 ++- FrontendWebApi/Models/Device.cs | 1 + 5 files changed, 181 insertions(+), 123 deletions(-) diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index b08ed6b..5165df3 100644 --- a/Frontend/_sysMonAll.html +++ b/Frontend/_sysMonAll.html @@ -260,20 +260,31 @@ function show3DModel(urn) { launchViewerForHotspot(urn, (viewer, nodeIds) => { let devices = [{ + roomDbId: 7567, id: "Oficina 5", //name: "Oficina-", position: { x: 3.35, y: -4.81, z: 12.88 }, // x: 0, y: 25, z: -2.5 (3.35, -4.81, 12.88 sensorTypes: ["temperature", "humidity"] + }, { + roomDbId: 7567, + id: "Oficina 6", + //name: "Oficina-", + position: { x: 4.35, y: -4.81, z: 11.88 }, // x: 0, y: 25, z: -2.5 (3.35, -4.81, 12.88 + sensorTypes: ["temperature", "humidity"] + }, { + roomDbId: 7567, + id: "Oficina 7", + //name: "Oficina-", + position: { x: 6.35, y: -4.81, z: 16.88 }, // x: 0, y: 25, z: -2.5 (3.35, -4.81, 12.88 + sensorTypes: ["temperature", "humidity"] }]; let option = { - devices:devices, + devices: devices, } let heatMap = new ADHeatMaps(option); - let temp = 10; + heatMap.onComplete = function () { - debugger - heatMap.changeTemp(32); - + heatMap.changeTemp(7567, 32); } },"[name=forgeViewer]"); diff --git a/Frontend/_sysMonFloor.html b/Frontend/_sysMonFloor.html index d05cade..3335f16 100644 --- a/Frontend/_sysMonFloor.html +++ b/Frontend/_sysMonFloor.html @@ -22,20 +22,16 @@ - -