This commit is contained in:
dev02 2022-12-22 17:18:34 +08:00
commit 21e3890686
13 changed files with 117 additions and 87 deletions

View File

@ -40,13 +40,16 @@ namespace Backend.Controllers
try
{
List<Device_value> ds;
string url_slot = "slot:/TPE/B1|";
string url_slot = "slot:/TPE/B1|";//三菱
//string url_slot = "slot:/NTPC/B1|";//wsp
string top100 = "";//" top 100 ";
webRequestService svc = new webRequestService();
string bql = url_slot + "bql:select " + top100 + " * from control:ControlPoint ";
//ds = svc.obixQuery("http://192.168.0.136:8080/obix/config/Arena/Program/ObixQuery/query/", bql);
//ds = svc.obixQuery("http://localhost:8080/obix/config/Program/ObixQuery/query/", bql);
ds = svc.obixQuery("http://192.168.0.136:8080/obix/config/Program/ObixQuery/query/", bql);
ds = svc.obixQuery("http://192.168.0.136:8080/obix/config/Program/ObixQuery/query/", bql);//三菱
//ds = svc.obixQuery("http://192.168.0.136:8081/obix/config/Program/ObixQuery/query/", bql);//wsp
apiResult.Code = "0000";
apiResult.Data = ds;

View File

@ -17,6 +17,7 @@
"Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201
"Port": "js2LutKe+rdjzdxMPQUrvQ==",
"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30
//"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp
"Root": "SzdxEgaJJ7tcTCrUl2zKsA==",
"Password": "FVAPxztxpY4gJJKQ/se4bQ=="
}

View File

@ -308,22 +308,14 @@
//取得第一筆電錶
function getFirstEletric() {
let url = baseApiUrl + "/api/Device/GetDeviceList";
let sendData = {
sub_system_tag: "E4",
building_tag: pageAct.buiTag,
};
objSendData.Data = sendData;
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
let url = baseApiUrl + "/api/Energe/GetElecBySubSysTag";
ytAjax = new YourTeam.Ajax(url, null, function (res) {
if (!res || res.code != "0000" || !res.data) {
} else {
$.each(res.data, (index, floObj) => {
$.each(floObj.device_list, (index2, devObj) => {
tarElePath = devObj.device_number;
})
})
subSysElecList = res.data;
tarElePath = subSysElecList.filter(x => x.mainSubTag == "total")[0]?.system_device_tag ?? "";
startPageLoading();
getSubBaja();
getElectricBaja();
@ -803,6 +795,7 @@
function subDeviceSetStatus() {
let subOrdPath = {
"area_tag": pageAct.AreaTag,
"building_tag": pageAct.buiTag,
"system_tag": "ELEV",
"name_tag": "EL",

View File

@ -920,6 +920,7 @@
var elev3DOption = {};
var elev3DObj = [];
var subOrdPath = {
"area_tag": pageAct.AreaTag,
"building_tag": pageAct.buiTag,
"system_tag": pageAct.sysMainTag,
"name_tag": pageAct.sysSubTag,
@ -1970,8 +1971,6 @@
var dataPoint = floChart.convertFromPixel({ geoIndex: 0 }, pixelPoint);
console.log(dataPoint);
temp_device_on_floor_map = [{
device_guid: selected_temp_device.device_guid,
device_full_name: selected_temp_device.device_full_name,

View File

@ -1,9 +1,8 @@
<style>
</style>
<div class="row">
<div class="col-sm-12 col-xl-5">
<div class="col-sm-12 col-xl-6">
<div class="d-flex mb-4" style="gap:15px">
<div class="row m-0 align-items-center">
<span id="sysNorLight" class="circle-light mr-2 " data-light-type="normal"></span>
@ -37,17 +36,20 @@
<script>
var allDevList = []; //全設備清單
$(function () {
getFloDevList();
setLightColor();
subDevice();
})
//baja 訂閱設備
function subDevice() {
if (myBaja == null) {
myBaja = new subscriptionDevices();
var ordPath = {
"area_tag": pageAct.AreaTag,
"building_tag": pageAct.buiTag,
"system_tag": pageAct.sysMainTag,
"name_tag": pageAct.sysSubTag,
@ -76,7 +78,7 @@
myBaja.setSubscribeDeviceEndCallBack(function (data) {
endPageLoading();
});
}
}
//根據 data-type 設置顏色 (判斷後台是否有設定,若無則帶預設)
function setLightColor() {
@ -121,14 +123,14 @@
} else {
let strHtml = ``;
$.each(res.data, (index, floObj) => {
strHtml += `<div class='d-flex justify-content-start mb-5' style="">`
strHtml += `<button id="floItemBtn${floObj.full_name}" type="button" class="btn btn-primary waves-effect waves-themed mr-5 align-self-center" >${floObj.full_name}</button>`
strHtml += `<div class='d-flex justify-content-start mb-5 ' style="">`
strHtml += `<button id="floItemBtn${floObj.full_name}" type="button" class="btn btn-primary waves-effect waves-themed mr-5 mt-1 align-self-start" >${floObj.full_name}</button>`
strHtml += `<div class="col p-0 d-grid grid-gap-5 grid-temp-col-c" style="--c-grid-temp-col:repeat(auto-fill,minmax(250px,1fr))">`
$.each(floObj.device_list, (index2, devObj) => {
console.log(">>>> url: " + baseImgUrl + " , img: " + varPathImg + ", icon: " + devObj.device_master_icon);
allDevList.push(devObj);
strHtml += `<div class="card m-1 border device-wrap" style="width:300px">
strHtml += `<div class="card m-1 border device-wrap">
<div class="card-body p-2">
<div class="d-flex mb-2">
<div class="mr-5 cur-poi">
@ -146,8 +148,13 @@
</div>
</div>`;
})
strHtml += "</div>"
strHtml += "</div></div>";
})
if (!res.data || res.data.length == 0) {
endPageLoading();
} else {
subDevice();
}
$("#floDevList").append(strHtml);
initPopover();
}

View File

@ -18,7 +18,7 @@
<script>
var floList = [];
var myBaja = null;
$(function () {
$("#sysSubText").text(pageAct.sysSubName);
getFloList();

View File

@ -207,6 +207,22 @@ input.toggle:checked {
input:-webkit-autofill {
background-color:rgba(0, 0, 0, 0.15)!important;
}
.d-grid {
display: grid;
}
.grid-gap-1 { grid-gap: 1px; }
.grid-gap-2 { grid-gap: 2px; }
.grid-gap-3 { grid-gap: 3px; }
.grid-gap-4 { grid-gap: 4px; }
.grid-gap-5 { grid-gap: 5px; }
.grid-gap-c { grid-gap: var(--c-grid-gap); }
.grid-temp-col-c {
grid-template-columns: var(--c-grid-temp-col);
}
@keyframes lds-ring {
0% {
transform: rotate(0deg);

View File

@ -2036,6 +2036,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
var loadingTip = '';
var pageAct = {}; //記錄全頁面已選擇項目
pageAct.AreaTag = "TPE";
if (localStorage.getItem("buiTag")) {
pageAct.buiTag = localStorage.getItem("buiTag");
}
if (location.href.indexOf("ord") != -1) {
location.href = "/file/index.html"
}
@ -2149,7 +2153,11 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
} else {
let strHtml = ``;
$.each(res.data, (index, buiObj) => {
strHtml += `<a id="buiBtn${buiObj.building_tag}" data-urn="${buiObj.urn_3D}" class="dropdown-item" href="javascript:;">${buiObj.full_name}</a>`;
let actStr = "";
if (pageAct.buiTag == buiObj.building_tag) {
actStr = "active";
}
strHtml += `<a id="buiBtn${buiObj.building_tag}" data-urn="${buiObj.urn_3D}" class="dropdown-item ${actStr}" href="javascript:;">${buiObj.full_name}</a>`;
})
$("#buiList").append(strHtml).droSetItem(); //droSetItem 預設第一筆 active
}
@ -2241,9 +2249,9 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
onEvent("active:change", "#buiList", function (e, actEle) {
if (actEle) {
pageAct.buiTag = $(actEle).prop("id").split("buiBtn")[1];
localStorage.setItem("buiTag", pageAct.buiTag);
pageAct.urn = $(actEle).data("urn");
}
})
$(window).on("timeout:3s", function () {
@ -2395,7 +2403,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
//loadErrRecTable2($(oriEle).data("number"));
//loadErrRecTable();
loadErr($(oriEle).data("number"));
subDeviceSetTable ? subDeviceSetTable($(oriEle).data("number")) : ""
typeof subDeviceSetTable != "undefined" ? subDeviceSetTable($(oriEle).data("number")) : ""
}
})
})

View File

@ -147,8 +147,8 @@ function BajaSubscribeDevicesByBql() {
// 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`)
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;
@ -296,7 +296,7 @@ function BajaSubscribeAlarmsByBql(ordPathForAlarm) {
var sourceState = (this.$map.$map.in10.$val.$map.$map.value.$display) == 'true' ? "Offnormal" : "Normal";
var modify_target_device = {
"system": "TPE_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
"system": ordPathForAlarm.area_tag + "_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
"sourceState": sourceState ? sourceState : null
}
@ -307,8 +307,8 @@ function BajaSubscribeAlarmsByBql(ordPathForAlarm) {
});
//使用bql語法
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`)
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`)
.get(
function (table) {
var tableStart, tableFinish;
@ -338,7 +338,7 @@ function BajaSubscribeAlarmsByBql(ordPathForAlarm) {
var normalTime = this.getDisplay("normalTime");
var modify_target_device = {
"system": "TPE_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
"system": ordPathForAlarm.area_tag + "_" + ordPathForAlarm.building_tag + "_" + ordPathForAlarm.system_tag + "_" + ordPathForAlarm.name_tag,
"sourceState": sourceState ? sourceState : null
}
totalTargetDevice.push(modify_target_device);

View File

@ -62,7 +62,7 @@ namespace Repository.Helper
var passwordStr = ed.AESDecrypt(_mySqlDBConfig.Password); //
//var serverStr = ed.AESEncrypt("192.168.0.201"); //192.168.0.201
//var portStr = ed.AESEncrypt("33306"); // 33306
//var databaseStr = ed.AESEncrypt("bims_mitsubishi"); // bims_mitsubishi
//var databaseStr = ed.AESEncrypt("bims_mitsubishi"); // bims_wsp: IgYBsgG2VLKKxFb64j7LOA== ; bims_mitsubishi
//var rootStr = ed.AESEncrypt("bims"); // bims
//var passwordStr = ed.AESEncrypt("mjmdev_BIMS2022"); // mjmdev_BIMS2022
var connStr = $"server={serverStr};port={portStr};database={databaseStr};user={rootStr};password={passwordStr};charset=utf8;Allow User Variables=True;";

View File

@ -9,7 +9,7 @@
connectionString="Data Source=192.168.0.201:33306;Initial Catalog=bims_mitsubishi;Persist Security Info=True;User ID=bims;Password=mjmdev_BIMS2022"
providerName="MySql.Data.MySqlClient" />-->
<add name="dbConStr" connectionString="server=192.168.0.201;user=bims;Database=bims_mitsubishi;Port=33306;password=mjmdev_BIMS2022;charset='utf8';pooling=true;sslmode=none;;Connection Timeout=6000" providerName="MySql.Data.MySqlClient" />
<add name="dbConStr" connectionString="server=192.168.0.201;user=bims;Database=bims_wsp;Port=33306;password=mjmdev_BIMS2022;charset='utf8';pooling=true;sslmode=none;;Connection Timeout=6000" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
</configuration>

View File

@ -149,24 +149,24 @@ namespace tpDomeWinAPP.Service
String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(username + ":" + password));
String API_Url = urlString;
//HttpWebRequest Postrequest = (HttpWebRequest)WebRequest.Create(API_Url);
//Postrequest.Method = "POST";
//Postrequest.Headers.Add("Authorization", "Basic " + encoded);
//Postrequest.PreAuthenticate = true;
HttpWebRequest Postrequest = (HttpWebRequest)WebRequest.Create(API_Url);
Postrequest.Method = "POST";
Postrequest.Headers.Add("Authorization", "Basic " + encoded);
Postrequest.PreAuthenticate = true;
//using (var streamWriter = new StreamWriter(Postrequest.GetRequestStream()))
//{
// string json = "<str val='" + bql + "'/>";
using (var streamWriter = new StreamWriter(Postrequest.GetRequestStream()))
{
string json = "<str val='" + bql + "'/>";
// streamWriter.Write(json);
//}
streamWriter.Write(json);
}
//HttpWebResponse response = (HttpWebResponse)Postrequest.GetResponse();
//var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
HttpWebResponse response = (HttpWebResponse)Postrequest.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
XmlDocument xmlDoc = new XmlDocument();
//xmlDoc.LoadXml(responseString);
xmlDoc.Load("N4v1021.xml");//N4v1021
xmlDoc.LoadXml(responseString);
//xmlDoc.Load("N4v1021.xml");//N4v1021
//xmlDoc.Save("N4.xml");

View File

@ -166,8 +166,11 @@ namespace tpDomeWinAPP
if (tabControl1.SelectedIndex == 0)
{
webRequestSvc svc = new webRequestSvc();
string bql = url_slot + "bql:select " + top100 + " * from control:ControlPoint ";
ds = svc.obixQuery("http://60.251.164.125:8080/obix/config/Arena/Program/ObixQuery/query/", bql);
string url_slot2 = "slot:/NTPC/B1|";//wsp
string bql = url_slot2 + "bql:select " + top100 + " * from control:ControlPoint ";//三菱: url_slot; wsp: url_slot2
//ds = svc.obixQuery("http://60.251.164.125:8080/obix/config/Arena/Program/ObixQuery/query/", bql);
//ds = svc.obixQuery("http://192.168.0.136:8080/obix/config/Program/ObixQuery/query/", bql);//三菱
ds = svc.obixQuery("http://192.168.0.136:8081/obix/config/Program/ObixQuery/query/", bql);//wsp
//ds = svc.obixQuery("http://localhost:8080/obix/config/Program/ObixQuery/query/", bql);
dataGridView1.DataSource = ds;
dataGridView1.Columns[0].Visible = false;