From c4a13606775aa63d92cadca88cb73ae444371c7b Mon Sep 17 00:00:00 2001 From: dev01 Date: Tue, 3 Jan 2023 16:47:23 +0800 Subject: [PATCH] =?UTF-8?q?[Frontend][=E5=85=A8=E5=9F=9F=E5=8A=9F=E8=83=BD?= =?UTF-8?q?]=20=E9=9B=BB=E6=A2=AF=20elevator3D=20Forge=20=E9=81=8D?= =?UTF-8?q?=E6=AD=B7=E9=81=8D=E5=88=B0=E5=BA=95=E7=A8=8B=E5=BA=8F=E5=BB=BA?= =?UTF-8?q?=E7=BD=AE=20|=20ADHeatMaps=20=E7=86=B1=E5=9C=96=20roomDbid?= =?UTF-8?q?=E4=BB=A5=E5=A4=96=E9=83=A8=E5=82=B3=E5=85=A5=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=AA=BF=E6=95=B4=20|=203D=20=E5=89=96=E9=9D=A2=E6=A1=86?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=8E=9F=E4=BB=A5=E6=A8=A1=E7=B3=8A=E6=AF=94?= =?UTF-8?q?=E5=B0=8D=E6=A8=93=E5=B1=A4=E5=90=8D=E7=A8=B1=E6=94=B9=E4=BB=A5?= =?UTF-8?q?=E6=AD=A3=E8=A6=8F=E5=8C=96=E5=AD=97=E4=B8=B2=E6=AF=94=E5=B0=8D?= =?UTF-8?q?=20|=20=E5=8F=96=E5=BE=97=E8=B3=87=E6=96=99=E5=BA=AB=E9=9B=BB?= =?UTF-8?q?=E6=A2=AF=E8=A8=AD=E5=82=99=EF=BC=8C=E6=A0=B9=E6=93=9Abaja?= =?UTF-8?q?=E8=A8=82=E9=96=B1=E7=A7=BB=E5=8B=953D=E9=9B=BB=E6=A2=AF?= =?UTF-8?q?=E5=85=B1=E7=94=A8CLASS(Forge3DElevFull)=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=BB=BA=E7=BD=AE=20|=20Map=20to=20ArrObj=20=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=BB=BA=E7=BD=AE=20|=20[=E5=84=80=E9=8C=B6=E6=9D=BF]=20?= =?UTF-8?q?=E5=A5=97=E7=94=A8=20Forge3DElevFull=20class=20|=20[=E8=83=BD?= =?UTF-8?q?=E6=BA=90=E7=AE=A1=E7=90=86]=20=E9=A0=88=E9=87=8F=E7=94=A8?= =?UTF-8?q?=E9=9B=BB=E5=8F=AA=E6=9C=89=E9=9B=BB=E6=BA=90=E6=89=8D=E6=9C=89?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=AA=BF=E6=95=B4=20|=20[=E9=9B=BB=E6=A2=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86]=20=E5=A5=97=E7=94=A8=20Forge3DElevFull=20cl?= =?UTF-8?q?ass=20|=20[=E7=B3=BB=E7=B5=B1=E7=9B=A3=E6=8E=A7]=20=E7=B8=BD?= =?UTF-8?q?=E6=94=AC=E3=80=81=E5=B9=B3=E9=9D=A2=E5=9C=96=E5=A5=97=E7=94=A8?= =?UTF-8?q?=20Forge3DElevFull=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_dashboard.html | 96 ++++---- Frontend/_energyManagement.html | 53 ++-- Frontend/_sysElevator.html | 416 +++++++++++--------------------- Frontend/_sysMonAll.html | 132 +++++----- Frontend/_sysMonFloor.html | 121 +++++++++- Frontend/js/forge/forgemodel.js | 121 ++++++---- Frontend/js/site.js | 237 ++++++++++++++++-- Frontend/js/style.js | 12 + 8 files changed, 717 insertions(+), 471 deletions(-) diff --git a/Frontend/_dashboard.html b/Frontend/_dashboard.html index 0cbeb9d..7205100 100644 --- a/Frontend/_dashboard.html +++ b/Frontend/_dashboard.html @@ -271,18 +271,18 @@ ]; var tempSysSubText = [ - { text: "高壓配電盤" ,mainSys: "EE", subSys: "E1", }, - { text: "低壓配電盤" ,mainSys: "EE", subSys: "E2", }, - { text: "緊急發電機" ,mainSys: "EE", subSys: "E3", }, - { text: "電錶系統" ,mainSys: "EE", subSys: "E4", }, - { text: "二線式照明系統" ,mainSys: "LT", subSys: "L1", }, - { text: "小型送風機" ,mainSys: "ME", subSys: "M10", }, - { text: "環境感測設備" ,mainSys: "ME", subSys: "M12", }, - { text: "電梯設備" ,mainSys: "ELEV", subSys: "EL", }, - { text: "消防設備" ,mainSys: "FE", subSys: "F1", }, - { text: "排煙系統" ,mainSys: "FE", subSys: "F2", }, - { text: "電子水錶" ,mainSys: "WP", subSys: "W1", }, - { text: "門禁安全系統" ,mainSys: "S", subSys: "R", } + { text: "高壓配電盤", mainSys: "EE", subSys: "E1", }, + { text: "低壓配電盤", mainSys: "EE", subSys: "E2", }, + { text: "緊急發電機", mainSys: "EE", subSys: "E3", }, + { text: "電錶系統", mainSys: "EE", subSys: "E4", }, + { text: "二線式照明系統", mainSys: "LT", subSys: "L1", }, + { text: "小型送風機", mainSys: "ME", subSys: "M10", }, + { text: "環境感測設備", mainSys: "ME", subSys: "M12", }, + { text: "電梯設備", mainSys: "ELEV", subSys: "EL", }, + { text: "消防設備", mainSys: "FE", subSys: "F1", }, + { text: "排煙系統", mainSys: "FE", subSys: "F2", }, + { text: "電子水錶", mainSys: "WP", subSys: "W1", }, + { text: "門禁安全系統", mainSys: "S", subSys: "R", } ]; $(document).ready(function () { @@ -783,12 +783,13 @@ //} function show3DModel() { - launchViewerNoTools(pageAct.urn, (viewer, nodeIds) => { - nodeIds = Array.from(nodeIds); + launchViewerNoTools(pageAct.urn, (viewer) => { + let nodeIds = allEleDevList.filter(x => !isNaN(parseInt(x.forge_dbid))).map(x => { return { devNum: x.device_number, nodeId: parseInt(x.forge_dbid) } }); + $.each(nodeIds, (idx, item) => { - elev3DBind[item[0]] = item[1]; + elev3DBind[item.devNum] = item.nodeId; }) - nodeIds = nodeIds.map(x => x[1]); + nodeIds = nodeIds.map(x => x.nodeId); $.each(nodeIds, function (idx, node) { let options = { element: $("#forgeViewer"), @@ -838,44 +839,41 @@ myBaja = new subscriptionDevices(); myBaja.setSubscribeDevicesByBql(subOrdPath); myBaja.setSubscribeDevicesCallBack(function (data) { - try { - if (allEleDevList.length == 0) { - return false; - } - data.device_number = data.device_number_full; - let matchDevice = allEleDevList.filter(x => x.device_number == data.device_number)[0]; - let master = matchDevice?.device_number.split("_")[5]; + if (allEleDevList.length == 0) { + return false; + } + data.device_number = data.device_number_full; + let matchDevice = allEleDevList.filter(x => x.device_number == data.device_number)[0]; + let master = matchDevice?.device_number.split("_")[5]; - if (!matchDevice) { - return; - } - - if (data.point_name == "CP") { - if (elev3DObj.length != 0) { - let elevObj = elev3DObj.filter(x => x.nodeId == elev3DBind[matchDevice.device_number])[0]; - if (elevObj && elevObj.id) { - elevObj.obj.setElevatorFloor(data.value) - elevObj.obj.movElevator(); - } + if (!matchDevice) { + return; + } + + if (data.point_name == "CP") { + if (elev3DObj.length != 0) { + let elevObj = elev3DObj.filter(x => x.nodeId == elev3DBind[matchDevice.device_number])[0]; + if (elevObj && elevObj.id) { + elevObj.obj.setElevatorFloor(data.value) + elevObj.obj.movElevator(); } } - - //將訂閱值塞入 subSeviceData - if (subSeviceData.findIndex(x => x.device_number == matchDevice.device_number) == -1) { - let obj = {}; - obj.device_number = matchDevice.device_number; - subSeviceData.push(obj) - } - - let subData = subSeviceData.filter(x => x.device_number == matchDevice.device_number)[0]; - - if (subData) { - subData[data.point_name] = data.value; - } - } catch (e) { - console.log("e", e) } + + //將訂閱值塞入 subSeviceData + if (subSeviceData.findIndex(x => x.device_number == matchDevice.device_number) == -1) { + let obj = {}; + obj.device_number = matchDevice.device_number; + subSeviceData.push(obj) + } + + let subData = subSeviceData.filter(x => x.device_number == matchDevice.device_number)[0]; + + if (subData) { + subData[data.point_name] = data.value; + } + }); myBaja.setSubscribeDeviceEndCallBack(function (data) { diff --git a/Frontend/_energyManagement.html b/Frontend/_energyManagement.html index b1ca50c..512cc76 100644 --- a/Frontend/_energyManagement.html +++ b/Frontend/_energyManagement.html @@ -48,7 +48,7 @@ -
+
@@ -227,24 +227,41 @@ $.each(mainSysObj.history_Sub_systems, (index2, subSysObj) => { subSysList.push(subSysObj); if (type == 0 || (type == 3 && mainSysObj.main_system_tag == "ELEV")) { - strHtml += `
-
-
-

${subSysObj.full_name}用電

-

- ${elecCardConText[type]?.text1} - -

-

- ${elecCardConText[type]?.text2} - -

+ strHtml += `
+
+
+

${subSysObj.full_name}用電

+

+ ${elecCardConText[type]?.text1} + +

+

+ ${elecCardConText[type]?.text2} + +

+
-
-
`; +
`; } }) }) + if (type == 3) { + strHtml += `
+
+
+

太陽能設備用電

+

+ ${elecCardConText[type]?.text1} + --- +

+

+ ${elecCardConText[type]?.text2} + --- +

+
+
+
`; + } $("#eneSubSysList").html(strHtml); } }, null, "POST").send(); @@ -518,5 +535,11 @@ if (type == "1" || type == "2") { $("#eneSubSysList").parent("div").hide(); } + // 自動需量 + if (type != "0") { + $("#elecAutoReq").hide(); + } else { + $("#elecAutoReq").show(); + } }) \ No newline at end of file diff --git a/Frontend/_sysElevator.html b/Frontend/_sysElevator.html index afe49fd..43e788f 100644 --- a/Frontend/_sysElevator.html +++ b/Frontend/_sysElevator.html @@ -1,63 +1,25 @@
@@ -160,7 +122,7 @@ - +