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 @@ -
- ${elecCardConText[type]?.text1} - -
-- ${elecCardConText[type]?.text2} - -
+ strHtml += `+ ${elecCardConText[type]?.text1} + +
++ ${elecCardConText[type]?.text2} + +
++ ${elecCardConText[type]?.text1} + --- +
++ ${elecCardConText[type]?.text2} + --- +
+