+
${drawStateTabBlo(devNum)}
@@ -1107,18 +1122,27 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
}
$(tooltipEle).draggable({
cursor: "move",
- handle: ".card-header" // 只能通过卡片的标题栏拖拽
+ handle: ".card-header", // 只能通过卡片的标题栏拖拽
+ containment: "document",
+ scroll: true
});
$(tooltipEle).resizable({
resize: function (event,ui) {
let iframe = $(ui.element).find("iframe");
if (iframe.length != 0) {
- //let cardBodyHei = $(ui.element).find(".card-body").css("height");
- //if (cardBodyHei) {
- // $(iframe).css("height", cardBodyHei);
- //}
+ if (ui.size.width != ui.originalSize.width) {
+ iframe.css("width", "100%");
+ } else if (ui.size.height != ui.originalSize.height) {
+ iframe.css("height", "100%");
+ }
}
- }
+ let cardBodyHeight = $(ui.element).find(".card-body").css("height");
+ $(ui.element).find(".scrolledTable").css("height", cardBodyHeight)
+
+ errRecTable.draw(false)
+ },
+ minWidth: 200,
+ minHeight:150,
});
typeof subDeviceSetTable != "undefined" ? subDeviceSetTable($(oriEle).data("number")) : ""
},
@@ -1173,7 +1197,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
];
- opeRecTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, null, null, null, null, null, null, "tpi");
+ opeRecTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, null, null, null, null, null, null, "<'scrolledTable'tpi>");
}
function loadLightSchTable(devGuid) {
@@ -1295,7 +1319,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
let json_object = JSON.parse(result);
datas = json_object['data'];
- errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "tpi");
+ errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "<'scrolledTable'tpi>");
}
@@ -1351,6 +1375,14 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
$(loadEle).Loading("close");
}
+ function setSysTagForPageAct(obj) {
+ pageAct.sysMainTag = $(obj).data("subSysObj").main_system_tag;
+ pageAct.sysSubTag = $(obj).data("subSysObj").sub_system_tag;
+ pageAct.sysSubName = $(obj).data("subSysObj").full_name;
+ pageAct.sysSubObj = $(obj).data("subSysObj");
+ getDevItem();
+ }
+
function getDevItem() {
let url = baseApiUrl + "/api/Device/GetDeviceItem";
@@ -1481,7 +1513,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
} else {
$("#sysMonBtnList").html("")
- debugger
+
$.each(res.data.history_Main_Systems, (index, mainSysObj) => {
$.each(mainSysObj.history_Sub_systems, (index2, subSysObj) => {
let page = "systemMonitor";
diff --git a/Frontend/js/forge/forgemodel.js b/Frontend/js/forge/forgemodel.js
index ceff637..a021bc5 100644
--- a/Frontend/js/forge/forgemodel.js
+++ b/Frontend/js/forge/forgemodel.js
@@ -1106,6 +1106,7 @@ async function newLight(lightPosition) {
//聚光燈
var spotLight = new THREE.SpotLight(0xffffff, 200, 20, 0.6, 0.5, 10);
spotLight.position.set(lightPosition.x, lightPosition.y, lightPosition.z);
+ console.log(lightPosition.x, lightPosition.y, lightPosition.z)
spotLight.castShadow = false;
spotLight.visible = true;
spotLight.target.position.set(lightPosition.x, lightPosition.y, lightPosition.z-20);
diff --git a/Frontend/js/n4js/bajatest.js b/Frontend/js/n4js/bajatest.js
index 48a98b9..29849a5 100644
--- a/Frontend/js/n4js/bajatest.js
+++ b/Frontend/js/n4js/bajatest.js
@@ -21,27 +21,238 @@ var endPageLoading; // 開始 loading
window.tolSubList = [];
var user_name = "";
-function subscriptionDevices() {
- // 用BQL的方式去訂閱
- this.setSubscribeDevicesByBql = function (tempOrdPath) {
- ordPath = tempOrdPath;
- BajaSubscribeDevicesByBql();
+
+class subscriptionDevices {
+ constructor() {
+ this.ordPath = {};
+ this.changeCallback = null;
+ this.changeEndCallback = null;
+ }
+
+ setSubscribeDevicesByBql = function (tempOrdPath) {
+ this.ordPath = tempOrdPath;
+ this.BajaSubscribeDevicesByBql();
};
- // BQL去訂閱回傳的Function
- this.setSubscribeDevicesCallBack = function (callBackFunc) {
+
+ setSubscribeDevicesCallBack = function (callBackFunc) {
if (callBackFunc != undefined && callBackFunc != null) {
- baja_subscribe_device_callback_func = callBackFunc;
+ this.changeCallback = callBackFunc;
}
}
// BQL訂閱結束回傳的Function
- this.setSubscribeDeviceEndCallBack = function (callBackFunc) {
+ setSubscribeDeviceEndCallBack = function (callBackFunc) {
if (callBackFunc != undefined && callBackFunc != null) {
- baja_subscribe_end_device_callback_func = callBackFunc;
+ this.changeEndCallback = callBackFunc;
}
}
+ BajaSubscribeDevicesByBql = function () {
+ let _this = this;
+ require(['baja!'], function (baja) {
+ console.log("進入Function 準備執行BQL訂閱");
+ startPageLoading ? startPageLoading() : ""
+ var init_start = new Date(Date.now());
+ var sub = new baja.Subscriber();
+
+ sub.attach('changed', function (prop) {
+ if (prop.getName() === 'out') {
+ var out_value = this.getOutDisplay();
+ var target_device_number = this.$parent.getDisplayName().split('_').slice(0, 5).join('_');
+ var point_name = this.getDisplayName();
+
+ //依據Facets判斷回傳的內容值為何
+ var facets_split = this.getFacets1().$cEncStr.split('|');
+ var facets_arr = [];
+ facets_split.forEach(function (item, index) {
+ facets_arr.push(item.split('=s:'));
+ });
+
+ var facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
+
+ var point_out_split = this.getOutDisplay().split(' ');
+
+ let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
+
+ if (key == undefined) {
+ key = point_out_split[0];
+ }
+
+ var modify_target_device = {
+ "device_number": target_device_number ? target_device_number : null,
+ "device_number_full": this.$parent.getSlotPath().$names.join("_"),
+ "point_name": point_name ? point_name : null,
+ "value": key
+ }
+
+ if (_this.changeCallback != undefined && _this.changeCallback != null) {
+ _this.changeCallback(modify_target_device, true); //第2參數用在平面圖,刷新畫面
+ }
+ }
+ }, function (err) {
+ console.log(err)
+ });
+
+ //使用bql語法
+ // var building_tag = "H";
+ // var system_tag = "M10";
+ // baja.Ord.make(`ip:greencloud.fic.com.tw|foxs:|station:|slot:/Arena/${building_tag}/${system_tag}|bql:select name, displayname, slotPath, out.value, out from control:ControlPoint`)
+ console.log(`local:|foxs:|station:|slot:/TPE/${_this.ordPath.building_tag}/${_this.ordPath.system_tag}/${_this.ordPath.name_tag}|bql:select name, displayname, slotPath, out.value, out, facets from control:ControlPoint`);
+ baja.Ord.make(`local:|foxs:|station:|slot:/TPE/${_this.ordPath.building_tag}/${_this.ordPath.system_tag}/${_this.ordPath.name_tag}|bql:select name, displayname, slotPath, out.value, out, facets from control:ControlPoint`)
+ .get(
+ function (table) {
+ var tableStart, tableFinish;
+ var subStart, subFinish;
+ var component_index = 0;
+ var total_component_index = 0;
+ var totalTargetDevice = [];
+ var readBqlFinish = new Date(Date.now());
+ // $("#readPath-finish-timestamp").html(readBqlFinish.toISOString());
+ // $("#readPath-finish-time").html((readBqlFinish.getTime() - init_start.getTime()) / 1000 + "sec");
+ console.log("讀取路徑完成-花費時間", (readBqlFinish.getTime() - init_start.getTime()) / 1000 + "sec");
+ table.cursor({
+ before: function () {
+ totalTargetDevice = [];
+ tableStart = new Date(Date.now());
+ $("#table-start-timestamp").html(tableStart.toISOString());
+
+
+ },
+ each: function (item, index) {
+ if (index < 1) {
+ subStart = new Date(Date.now());
+ $("#sub-start").html(subStart.toISOString());
+ }
+ $("#sub-number").html(index + 1);
+ total_component_index = index;
+
+
+
+ var target_device_number_split = this.getDisplay("slotPath").split('/');
+ var target_device_number = target_device_number_split[8];
+ //console.log(target_device_number);
+ var point_name = this.getDisplay("name");
+ var facets = this.getDisplay("facets");
+
+ //依據Facets判斷回傳的內容值為何
+ var facets_split = facets.split(',');
+ var facets_arr = [];
+ facets_split.forEach(function (item, index) {
+ facets_arr.push(item.split('='));
+ });
+
+ facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
+
+ var point_out_split = this.getDisplay("out").split(' ');
+
+ let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
+
+ if (key == undefined) {
+ key = point_out_split[0];
+ }
+
+ var modify_target_device = {
+ "device_number": target_device_number ? target_device_number : null,
+ "device_number_full": this.getDisplay("slotPath").split("slot:")[1].split('/').slice(1, -1).join("_"),
+ "point_name": point_name ? point_name : null,
+ "value": key
+ }
+ totalTargetDevice.push(modify_target_device);
+ //取得component當下就更新設備點位
+ if (_this.changeCallback != undefined && _this.changeCallback != null) {
+ _this.changeCallback(modify_target_device);
+ }
+
+
+ baja.Ord.make("local:|foxs:|station:|" + this.getDisplay("slotPath"))
+ .get()
+ .then(function (component) {
+ component_index++;
+ var target_device_number = component.$parent.getDisplayName().split('_').slice(0, 5).join('_');
+ var point_name = component.getDisplayName();
+
+ // //依據Facets判斷回傳的內容值為何
+ // var facets_split = component.getFacets1().$cEncStr.split('|');
+ // var facets_arr = [];
+ // facets_split.forEach(function (item, index) {
+ // facets_arr.push(item.split('=s:'));
+ // });
+
+ // var facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
+
+ // var point_out_split = component.getOutDisplay().split(' ');
+
+ // let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
+
+ // if (key == undefined) {
+ // key = point_out_split[0];
+ // }
+
+ // var modify_target_device = {
+ // "device_number": target_device_number ? target_device_number : null,
+ // "point_name": point_name ? point_name : null,
+ // "value": key
+ // }
+
+ // //取得component當下就更新設備點位
+ // if (baja_subscribe_device_callback_func != undefined && baja_subscribe_device_callback_func != null) {
+ // if (component_index == total_component_index) {
+ // baja_subscribe_device_callback_func(modify_target_device, true);
+ // }
+ // else {
+ // baja_subscribe_device_callback_func(modify_target_device);
+ // }
+ // }
+
+ sub.subscribe({
+ comps: component,
+ });
+ tolSubList.push(sub);
+ subFinish = new Date(Date.now());
+ $("#sub-end").html(subFinish.toISOString());
+ $("#sub-time").html((subFinish.getTime() - subStart.getTime()) / 1000 + "sec");
+ // console.log("訂閱完成時間", (subFinish.getTime() - subStart.getTime()) / 1000 + "sec");
+ });
+ },
+ after: function () {
+ tableFinish = new Date(Date.now());
+ // $("#table-finish-timestamp").html(tableFinish.toISOString());
+ // $("#table-time").html((tableFinish.getTime() - tableStart.getTime()) / 1000 + "sec");
+ //取得component當下就更新設備點位
+ if (_this.changeEndCallback != undefined && _this.changeEndCallback != null) {
+ _this.changeEndCallback(totalTargetDevice);
+ }
+ endPageLoading ? endPageLoading() : ""
+ console.log("表格完成時間", (tableFinish.getTime() - tableStart.getTime()) / 1000 + "sec");
+ },
+ limit: -1,
+ offset: 0
+ });
+ });
+ })
+ }
}
+//function subscriptionDevices() {
+// // 用BQL的方式去訂閱
+// this.setSubscribeDevicesByBql = function (tempOrdPath) {
+// ordPath = tempOrdPath;
+// BajaSubscribeDevicesByBql();
+// };
+// // BQL去訂閱回傳的Function
+// this.setSubscribeDevicesCallBack = function (callBackFunc) {
+// if (callBackFunc != undefined && callBackFunc != null) {
+// baja_subscribe_device_callback_func = callBackFunc;
+// }
+// }
+// // BQL訂閱結束回傳的Function
+// this.setSubscribeDeviceEndCallBack = function (callBackFunc) {
+// if (callBackFunc != undefined && callBackFunc != null) {
+// baja_subscribe_end_device_callback_func = callBackFunc;
+// }
+// }
+
+//}
+
function subscriptionAlarms() {
// 用BQL的方式去訂閱
this.setSubscribeAlarmsByBql = function (tempOrdPath) {
@@ -96,191 +307,191 @@ function MyBaja() {
/**
* 使用者透過BQL指定路徑去訂閱設備點位
*/
-function BajaSubscribeDevicesByBql() {
+//function BajaSubscribeDevicesByBql() {
- require(['baja!'], function (baja) {
- console.log("進入Function 準備執行BQL訂閱");
- startPageLoading ? startPageLoading() : ""
- var init_start = new Date(Date.now());
- var sub = new baja.Subscriber();
+// require(['baja!'], function (baja) {
+// console.log("進入Function 準備執行BQL訂閱");
+// startPageLoading ? startPageLoading() : ""
+// var init_start = new Date(Date.now());
+// var sub = new baja.Subscriber();
- sub.attach('changed', function (prop) {
- if (prop.getName() === 'out') {
- var out_value = this.getOutDisplay();
- var target_device_number = this.$parent.getDisplayName().split('_').slice(0, 5).join('_');
- var point_name = this.getDisplayName();
+// sub.attach('changed', function (prop) {
+// if (prop.getName() === 'out') {
+// var out_value = this.getOutDisplay();
+// var target_device_number = this.$parent.getDisplayName().split('_').slice(0, 5).join('_');
+// var point_name = this.getDisplayName();
- //依據Facets判斷回傳的內容值為何
- var facets_split = this.getFacets1().$cEncStr.split('|');
- var facets_arr = [];
- facets_split.forEach(function (item, index) {
- facets_arr.push(item.split('=s:'));
- });
+// //依據Facets判斷回傳的內容值為何
+// var facets_split = this.getFacets1().$cEncStr.split('|');
+// var facets_arr = [];
+// facets_split.forEach(function (item, index) {
+// facets_arr.push(item.split('=s:'));
+// });
- var facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
+// var facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
- var point_out_split = this.getOutDisplay().split(' ');
+// var point_out_split = this.getOutDisplay().split(' ');
- let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
+// let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
- if (key == undefined) {
- key = point_out_split[0];
- }
+// if (key == undefined) {
+// key = point_out_split[0];
+// }
- var modify_target_device = {
- "device_number": target_device_number ? target_device_number : null,
- "device_number_full": this.$parent.getSlotPath().$names.join("_"),
- "point_name": point_name ? point_name : null,
- "value": key
- }
+// var modify_target_device = {
+// "device_number": target_device_number ? target_device_number : null,
+// "device_number_full": this.$parent.getSlotPath().$names.join("_"),
+// "point_name": point_name ? point_name : null,
+// "value": key
+// }
- if (baja_subscribe_device_callback_func != undefined && baja_subscribe_device_callback_func != null) {
- baja_subscribe_device_callback_func(modify_target_device, true); //第2參數用在平面圖,刷新畫面
- }
- }
- }, function (err) {
- console.log(err)
- });
+// if (baja_subscribe_device_callback_func != undefined && baja_subscribe_device_callback_func != null) {
+// baja_subscribe_device_callback_func(modify_target_device, true); //第2參數用在平面圖,刷新畫面
+// }
+// }
+// }, function (err) {
+// console.log(err)
+// });
- //使用bql語法
- // var building_tag = "H";
- // var system_tag = "M10";
- // baja.Ord.make(`ip:greencloud.fic.com.tw|foxs:|station:|slot:/Arena/${building_tag}/${system_tag}|bql:select name, displayname, slotPath, out.value, out from control:ControlPoint`)
- console.log(`local:|foxs:|station:|slot:/${ordPath.area_tag}/${ordPath.building_tag}/${ordPath.system_tag}/${ordPath.name_tag}|bql:select name, displayname, slotPath, out.value, out, facets from control:ControlPoint`);
- baja.Ord.make(`local:|foxs:|station:|slot:/${ordPath.area_tag}/${ordPath.building_tag}/${ordPath.system_tag}/${ordPath.name_tag}|bql:select name, displayname, slotPath, out.value, out, facets from control:ControlPoint`)
- .get(
- function (table) {
- var tableStart, tableFinish;
- var subStart, subFinish;
- var component_index = 0;
- var total_component_index = 0;
- var totalTargetDevice = [];
- var readBqlFinish = new Date(Date.now());
- // $("#readPath-finish-timestamp").html(readBqlFinish.toISOString());
- // $("#readPath-finish-time").html((readBqlFinish.getTime() - init_start.getTime()) / 1000 + "sec");
- console.log("讀取路徑完成-花費時間", (readBqlFinish.getTime() - init_start.getTime()) / 1000 + "sec");
- table.cursor({
- before: function () {
- totalTargetDevice = [];
- tableStart = new Date(Date.now());
- $("#table-start-timestamp").html(tableStart.toISOString());
- render_start = new Date(Date.now());
+// //使用bql語法
+// // var building_tag = "H";
+// // var system_tag = "M10";
+// // baja.Ord.make(`ip:greencloud.fic.com.tw|foxs:|station:|slot:/Arena/${building_tag}/${system_tag}|bql:select name, displayname, slotPath, out.value, out from control:ControlPoint`)
+// console.log(`local:|foxs:|station:|slot:/TPE/${ordPath.building_tag}/${ordPath.system_tag}/${ordPath.name_tag}|bql:select name, displayname, slotPath, out.value, out, facets from control:ControlPoint`);
+// baja.Ord.make(`local:|foxs:|station:|slot:/TPE/${ordPath.building_tag}/${ordPath.system_tag}/${ordPath.name_tag}|bql:select name, displayname, slotPath, out.value, out, facets from control:ControlPoint`)
+// .get(
+// function (table) {
+// var tableStart, tableFinish;
+// var subStart, subFinish;
+// var component_index = 0;
+// var total_component_index = 0;
+// var totalTargetDevice = [];
+// var readBqlFinish = new Date(Date.now());
+// // $("#readPath-finish-timestamp").html(readBqlFinish.toISOString());
+// // $("#readPath-finish-time").html((readBqlFinish.getTime() - init_start.getTime()) / 1000 + "sec");
+// console.log("讀取路徑完成-花費時間", (readBqlFinish.getTime() - init_start.getTime()) / 1000 + "sec");
+// table.cursor({
+// before: function () {
+// totalTargetDevice = [];
+// tableStart = new Date(Date.now());
+// $("#table-start-timestamp").html(tableStart.toISOString());
+// render_start = new Date(Date.now());
- },
- each: function (item, index) {
- if (index < 1) {
- subStart = new Date(Date.now());
- $("#sub-start").html(subStart.toISOString());
- }
- $("#sub-number").html(index + 1);
- total_component_index = index;
+// },
+// each: function (item, index) {
+// if (index < 1) {
+// subStart = new Date(Date.now());
+// $("#sub-start").html(subStart.toISOString());
+// }
+// $("#sub-number").html(index + 1);
+// total_component_index = index;
- var target_device_number_split = this.getDisplay("slotPath").split('/');
- var target_device_number = target_device_number_split[8];
- //console.log(target_device_number);
- var point_name = this.getDisplay("name");
- var facets = this.getDisplay("facets");
+// var target_device_number_split = this.getDisplay("slotPath").split('/');
+// var target_device_number = target_device_number_split[8];
+// //console.log(target_device_number);
+// var point_name = this.getDisplay("name");
+// var facets = this.getDisplay("facets");
- //依據Facets判斷回傳的內容值為何
- var facets_split = facets.split(',');
- var facets_arr = [];
- facets_split.forEach(function (item, index) {
- facets_arr.push(item.split('='));
- });
+// //依據Facets判斷回傳的內容值為何
+// var facets_split = facets.split(',');
+// var facets_arr = [];
+// facets_split.forEach(function (item, index) {
+// facets_arr.push(item.split('='));
+// });
- facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
+// facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
- var point_out_split = this.getDisplay("out").split(' ');
+// var point_out_split = this.getDisplay("out").split(' ');
- let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
+// let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
- if (key == undefined) {
- key = point_out_split[0];
- }
+// if (key == undefined) {
+// key = point_out_split[0];
+// }
- var modify_target_device = {
- "device_number": target_device_number ? target_device_number : null,
- "device_number_full": this.getDisplay("slotPath").split("slot:")[1].split('/').slice(1, -1).join("_"),
- "point_name": point_name ? point_name : null,
- "value": key
- }
- totalTargetDevice.push(modify_target_device);
- //取得component當下就更新設備點位
- if (baja_subscribe_device_callback_func != undefined && baja_subscribe_device_callback_func != null) {
- baja_subscribe_device_callback_func(modify_target_device);
- }
+// var modify_target_device = {
+// "device_number": target_device_number ? target_device_number : null,
+// "device_number_full": this.getDisplay("slotPath").split("slot:")[1].split('/').slice(1, -1).join("_"),
+// "point_name": point_name ? point_name : null,
+// "value": key
+// }
+// totalTargetDevice.push(modify_target_device);
+// //取得component當下就更新設備點位
+// if (baja_subscribe_device_callback_func != undefined && baja_subscribe_device_callback_func != null) {
+// baja_subscribe_device_callback_func(modify_target_device);
+// }
- baja.Ord.make("local:|foxs:|station:|" + this.getDisplay("slotPath"))
- .get()
- .then(function (component) {
- component_index++;
- var target_device_number = component.$parent.getDisplayName().split('_').slice(0, 5).join('_');
- var point_name = component.getDisplayName();
+// baja.Ord.make("local:|foxs:|station:|" + this.getDisplay("slotPath"))
+// .get()
+// .then(function (component) {
+// component_index++;
+// var target_device_number = component.$parent.getDisplayName().split('_').slice(0, 5).join('_');
+// var point_name = component.getDisplayName();
- // //依據Facets判斷回傳的內容值為何
- // var facets_split = component.getFacets1().$cEncStr.split('|');
- // var facets_arr = [];
- // facets_split.forEach(function (item, index) {
- // facets_arr.push(item.split('=s:'));
- // });
+// // //依據Facets判斷回傳的內容值為何
+// // var facets_split = component.getFacets1().$cEncStr.split('|');
+// // var facets_arr = [];
+// // facets_split.forEach(function (item, index) {
+// // facets_arr.push(item.split('=s:'));
+// // });
- // var facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
+// // var facets = facets_arr.reduce((obj, cur) => ({ ...obj, [cur[0]]: cur[1] }), {})
- // var point_out_split = component.getOutDisplay().split(' ');
+// // var point_out_split = component.getOutDisplay().split(' ');
- // let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
+// // let key = Object.keys(facets).find(k => facets[k] === point_out_split[0]);
- // if (key == undefined) {
- // key = point_out_split[0];
- // }
+// // if (key == undefined) {
+// // key = point_out_split[0];
+// // }
- // var modify_target_device = {
- // "device_number": target_device_number ? target_device_number : null,
- // "point_name": point_name ? point_name : null,
- // "value": key
- // }
+// // var modify_target_device = {
+// // "device_number": target_device_number ? target_device_number : null,
+// // "point_name": point_name ? point_name : null,
+// // "value": key
+// // }
- // //取得component當下就更新設備點位
- // if (baja_subscribe_device_callback_func != undefined && baja_subscribe_device_callback_func != null) {
- // if (component_index == total_component_index) {
- // baja_subscribe_device_callback_func(modify_target_device, true);
- // }
- // else {
- // baja_subscribe_device_callback_func(modify_target_device);
- // }
- // }
+// // //取得component當下就更新設備點位
+// // if (baja_subscribe_device_callback_func != undefined && baja_subscribe_device_callback_func != null) {
+// // if (component_index == total_component_index) {
+// // baja_subscribe_device_callback_func(modify_target_device, true);
+// // }
+// // else {
+// // baja_subscribe_device_callback_func(modify_target_device);
+// // }
+// // }
- sub.subscribe({
- comps: component,
- });
- tolSubList.push(sub);
- subFinish = new Date(Date.now());
- $("#sub-end").html(subFinish.toISOString());
- $("#sub-time").html((subFinish.getTime() - subStart.getTime()) / 1000 + "sec");
- // console.log("訂閱完成時間", (subFinish.getTime() - subStart.getTime()) / 1000 + "sec");
- });
- },
- after: function () {
- tableFinish = new Date(Date.now());
- // $("#table-finish-timestamp").html(tableFinish.toISOString());
- // $("#table-time").html((tableFinish.getTime() - tableStart.getTime()) / 1000 + "sec");
- //取得component當下就更新設備點位
- if (baja_subscribe_end_device_callback_func != undefined && baja_subscribe_end_device_callback_func != null) {
- baja_subscribe_end_device_callback_func(totalTargetDevice);
- }
- endPageLoading ? endPageLoading() : ""
- console.log("表格完成時間", (tableFinish.getTime() - tableStart.getTime()) / 1000 + "sec");
- },
- limit: -1,
- offset: 0
- });
- });
- })
-}
+// sub.subscribe({
+// comps: component,
+// });
+// tolSubList.push(sub);
+// subFinish = new Date(Date.now());
+// $("#sub-end").html(subFinish.toISOString());
+// $("#sub-time").html((subFinish.getTime() - subStart.getTime()) / 1000 + "sec");
+// // console.log("訂閱完成時間", (subFinish.getTime() - subStart.getTime()) / 1000 + "sec");
+// });
+// },
+// after: function () {
+// tableFinish = new Date(Date.now());
+// // $("#table-finish-timestamp").html(tableFinish.toISOString());
+// // $("#table-time").html((tableFinish.getTime() - tableStart.getTime()) / 1000 + "sec");
+// //取得component當下就更新設備點位
+// if (baja_subscribe_end_device_callback_func != undefined && baja_subscribe_end_device_callback_func != null) {
+// baja_subscribe_end_device_callback_func(totalTargetDevice);
+// }
+// endPageLoading ? endPageLoading() : ""
+// console.log("表格完成時間", (tableFinish.getTime() - tableStart.getTime()) / 1000 + "sec");
+// },
+// limit: -1,
+// offset: 0
+// });
+// });
+// })
+//}
/**
* 使用者透過BQL指定路徑去訂閱Alarm
@@ -296,7 +507,7 @@ function BajaSubscribeAlarmsByBql(ordPathForAlarm) {
var sourceState = (this.$map.$map.in10.$val.$map.$map.value.$display) == 'true' ? "Offnormal" : "Normal";
var modify_target_device = {
- "system": ordPathForAlarm.area_tag + "_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
+ "system": "TPE_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
"sourceState": sourceState ? sourceState : null
}
@@ -307,8 +518,8 @@ function BajaSubscribeAlarmsByBql(ordPathForAlarm) {
});
//使用bql語法
- console.log(`local:|foxs:|alarm:|bql:select top 1 timestamp, sourceState, normalTime where alarmData.sourceName like '%${ordPathForAlarm.area_tag}_${ordPathForAlarm.building_tag}_${ordPathForAlarm.system_tag}_${ordPathForAlarm.name_tag}_%' order by timestamp desc`);
- baja.Ord.make(`local:|foxs:|alarm:|bql:select top 1 timestamp, sourceState, alarmData, alarmData.sourceName, normalTime where alarmData.sourceName like '%${ordPathForAlarm.area_tag}_${ordPathForAlarm.building_tag}_${ordPathForAlarm.system_tag}_${ordPathForAlarm.name_tag}_%' order by timestamp desc`)
+ console.log(`local:|foxs:|alarm:|bql:select top 1 timestamp, sourceState, normalTime where alarmData.sourceName like '%TPE_${ordPathForAlarm.building_tag}_${ordPathForAlarm.system_tag}_${ordPathForAlarm.name_tag}_%' order by timestamp desc`);
+ baja.Ord.make(`local:|foxs:|alarm:|bql:select top 1 timestamp, sourceState, alarmData, alarmData.sourceName, normalTime where alarmData.sourceName like '%TPE_${ordPathForAlarm.building_tag}_${ordPathForAlarm.system_tag}_${ordPathForAlarm.name_tag}_%' order by timestamp desc`)
.get(
function (table) {
var tableStart, tableFinish;
@@ -338,7 +549,7 @@ function BajaSubscribeAlarmsByBql(ordPathForAlarm) {
var normalTime = this.getDisplay("normalTime");
var modify_target_device = {
- "system": ordPathForAlarm.area_tag + "_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
+ "system": "TPE_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
"sourceState": sourceState ? sourceState : null
}
totalTargetDevice.push(modify_target_device);