فهرست منبع

3dModeling UIAnchor.js 康雷 commit at 2021-01-08

康雷 4 سال پیش
والد
کامیت
a6bc945ac1
1فایلهای تغییر یافته به همراه35 افزوده شده و 0 حذف شده
  1. 35 0
      3dModeling/hswc3/UIAnchor.js

+ 35 - 0
3dModeling/hswc3/UIAnchor.js

@@ -157,3 +157,38 @@ function create_ui(deviceType, floorNum, deviceList) {
     if(floorNum == -1){
         num = 'B1'
     }else{
+        num = 'F' + floorNum;
+    }
+    var carList = app.query("#" + num)[0].query(deviceType)
+    var carList1 = app.query("#" + num)[0]
+    console.log(carList)
+    console.log(deviceIcon.length)
+    //   app.query("#" + id)[0].query('.Thing').forEach(function (obj){
+    //     var car = app.query("#"+obj.id)[0];
+    //     panelArr.push(uiAnchor(car));
+    // })
+    for (var i = 0; i < deviceIcon.length; i++) {
+        dName = deviceIcon[i].device_name;
+        var ownercode = deviceIcon[i].owner_code
+        console.log(dName,ownercode,carList[i])
+        ui = app.create({
+            type: 'UIAnchor',
+            parent: carList[i],
+            element: create_element(dName, deviceTypes, floorNum, ownercode),
+            localPosition: [0, 2, 0],
+            pivot: [0.5, 1] //  [0,0]即以界面左上角定位,[1,1]即以界面右下角进行定位
+        });
+        uis.push(ui);
+    }
+
+}
+// 删除界面
+function destroy_ui() {
+    if (uis) {
+        for (var i = 0; i < uis.length; i++) {
+            uis[i].destroy();
+        }
+        uis = [];
+    }
+
+}