diff --git a/HT.Cloud.Domain/Entity/SystemSecurity/RealTimeDevNetWorkEntity.cs b/HT.Cloud.Domain/Entity/SystemSecurity/RealTimeDevNetWorkEntity.cs new file mode 100644 index 0000000..e129ff5 --- /dev/null +++ b/HT.Cloud.Domain/Entity/SystemSecurity/RealTimeDevNetWorkEntity.cs @@ -0,0 +1,56 @@ +using System; +using System.ComponentModel.DataAnnotations; +using SqlSugar; + +namespace HT.Cloud.Domain.SystemSecurity +{ + /// + /// 创 建:cdl + /// 日 期:2024-01-04 10:56 + /// 描 述:IO模块实体类 + /// + [SugarTable("HT_REALTIME_DEVNETWORK")] + public class RealTimeDevNetWorkEntity + { + /// + /// + /// + [SugarColumn(ColumnName="ID", ColumnDescription = "",ColumnDataType = "int",IsPrimaryKey = true)] + public int ID { get; set; } + /// + /// + /// + [SugarColumn(ColumnName= "DeviceID", ColumnDescription = "",ColumnDataType = "int", IsNullable = true)] + public int? DeviceID { get; set; } + /// + /// + /// + [SugarColumn(ColumnName= "DeviceIOGroupID", ColumnDescription = "",ColumnDataType = "int", IsNullable = true)] + public int? DeviceIOGroupID { get; set; } + /// + /// + /// + [SugarColumn(ColumnName= "DeviceName", ColumnDescription = "",ColumnDataType = "varchar(128)", IsNullable = true)] + public string DeviceName { get; set; } + /// + /// + /// + [SugarColumn(ColumnName= "DeviceIP", ColumnDescription = "",ColumnDataType = "varchar(128)", IsNullable = true)] + public string DeviceIP { get; set; } + /// + /// + /// + [SugarColumn(ColumnName= "DeviceNetWorkStatus", ColumnDescription = "",ColumnDataType = "varchar(128)", IsNullable = true)] + public string DeviceNetWorkStatus { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "DeviceDESCRIPTION", ColumnDescription = "", ColumnDataType = "varchar(128)", IsNullable = true)] + public string DeviceDESCRIPTION { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "DeviceIncludeModel", ColumnDescription = "", ColumnDataType = "varchar(128)", IsNullable = true)] + public string DeviceIncludeModel { get; set; } + } +} diff --git a/HT.Cloud.Domain/Entity/SystemSecurity/RealTimeIOInfoEntity.cs b/HT.Cloud.Domain/Entity/SystemSecurity/RealTimeIOInfoEntity.cs index 822ab68..9d7ba90 100644 --- a/HT.Cloud.Domain/Entity/SystemSecurity/RealTimeIOInfoEntity.cs +++ b/HT.Cloud.Domain/Entity/SystemSecurity/RealTimeIOInfoEntity.cs @@ -32,5 +32,10 @@ namespace HT.Cloud.Domain.SystemSecurity /// [SugarColumn(ColumnName="IODESCRIPTION", ColumnDescription = "IO功能名称",ColumnDataType = "varchar(128)", IsNullable = true)] public string IODESCRIPTION { get; set; } - } + /// + /// IO功能名称 + /// + [SugarColumn(ColumnName = "IOTagName", ColumnDescription = "IOTag", ColumnDataType = "varchar(128)", IsNullable = true)] + public string IOTagName { get; set; } + } } diff --git a/HT.Cloud.Service/SystemSecurity/RealTimeIOStateService.cs b/HT.Cloud.Service/SystemSecurity/RealTimeIOStateService.cs index 67e7603..2f3e6b2 100644 --- a/HT.Cloud.Service/SystemSecurity/RealTimeIOStateService.cs +++ b/HT.Cloud.Service/SystemSecurity/RealTimeIOStateService.cs @@ -18,6 +18,7 @@ using Quartz; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using HT.Cloud.Domain.SystemSecurity; +using System.Net.NetworkInformation; namespace HT.Cloud.Service.SystemSecurity { @@ -41,8 +42,17 @@ namespace HT.Cloud.Service.SystemSecurity return list; } + public async Task> GetIOGroup(string systemName, string iogroupid) + { + var groupName = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().GroupName; + var driverId = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().DriverID; + var driverName = _context.AsTenant().QueryableWithAttr().Where(x => x.DriverID == driverId).First().DriverName; + var list = _context.AsTenant().GetConnection(dataDBNumber).Ado.SqlQuery($"SELECT * FROM HT_{driverName}_{groupName}_IOGROUP_{iogroupid}"); + return list; - public async Task> GetIOInfo(string systemName) + } + + public async Task> GetIOInfo(string systemName) { var groupName = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().GroupName; var driverId = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().DriverID; @@ -50,19 +60,71 @@ namespace HT.Cloud.Service.SystemSecurity var list = _context.AsTenant().GetConnection(dataDBNumber).Ado.SqlQuery($"SELECT * FROM HT_{driverName}_{groupName}_IOINFO"); return list; } - - public async Task GetRtData() + public async Task> GetIOInfo(string systemName, string iogroupid) + { + var groupName = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().GroupName; + var driverId = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().DriverID; + var driverName = _context.AsTenant().QueryableWithAttr().Where(x => x.DriverID == driverId).First().DriverName; + var list = _context.AsTenant().GetConnection(dataDBNumber).Ado.SqlQuery($"SELECT * FROM HT_{driverName}_{groupName}_IOINFO_{iogroupid}"); + return list; + } + public async Task> GetDevNetWork(string systemName) { - //var groupName = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().GroupName; + var groupName = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().GroupName; + var driverId = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().DriverID; + var driverName = _context.AsTenant().QueryableWithAttr().Where(x => x.DriverID == driverId).First().DriverName; + var list = _context.AsTenant().GetConnection(dataDBNumber).Ado.SqlQuery($"SELECT * FROM HT_{driverName}_{groupName}_DEVNETWORK"); + return list; + } + + public async Task> GetRealDevNetWork(string systemName) + { + var groupName = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().GroupName; + var driverId = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().DriverID; + var driverName = _context.AsTenant().QueryableWithAttr().Where(x => x.DriverID == driverId).First().DriverName; + var list = _context.AsTenant().GetConnection(dataDBNumber).Ado.SqlQuery($"SELECT * FROM HT_{driverName}_{groupName}_DEVNETWORK"); + var listNT = new List(); + foreach (var dev in list) + { + var devNT = new RealTimeDevNetWorkEntity(); + devNT = dev; + string message = ""; + string address = devNT.DeviceIP; + Ping ping = new Ping(); + try + { + PingReply pingReply = ping.Send(address,247); + if (pingReply.Status == IPStatus.Success) + { + devNT.DeviceNetWorkStatus = "True"; + } + else + { + devNT.DeviceNetWorkStatus = "False"; + } + } + catch (Exception e) + { + devNT.DeviceNetWorkStatus = "False"; + } + listNT.Add(devNT); + } + return listNT; + } + + + public async Task GetRtData(string systemName) + { + var groupName = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().GroupName; //var driverId = _context.AsTenant().QueryableWithAttr().Where(x => x.GroupDescription == systemName).First().DriverID; //var driverName = _context.AsTenant().QueryableWithAttr().Where(x => x.DriverID == driverId).First().DriverName; //var list = _context.AsTenant().GetConnection(dataDBNumber).Ado.SqlQuery($"SELECT * FROM HT_{driverName}_{groupName}_MAINPAGE"); - var remoteRtDataServer = " http://localhost:5276/TestIOApi/"; + //var remoteRtDataServer = " http://localhost:5276/TestIOApi/"; - var responseStr = RemoteHttpRequest.HttpGet(remoteRtDataServer); + var remoteRtDataServer = _context.AsTenant().QueryableWithAttr().First().remotertdataserver + $"?groupName={groupName}"; - + var responseStr = RemoteHttpRequest.HttpGet(remoteRtDataServer); JObject valueJson = JObject.Parse(responseStr); diff --git a/HT.Cloud.Web/Areas/PenMeiChartsManage/Views/PenMeiHistoryTechCharts/Index.cshtml b/HT.Cloud.Web/Areas/PenMeiChartsManage/Views/PenMeiHistoryTechCharts/Index.cshtml index 82fe5b4..188301a 100644 --- a/HT.Cloud.Web/Areas/PenMeiChartsManage/Views/PenMeiHistoryTechCharts/Index.cshtml +++ b/HT.Cloud.Web/Areas/PenMeiChartsManage/Views/PenMeiHistoryTechCharts/Index.cshtml @@ -541,7 +541,7 @@ showchart = async function () { //(document.getElementById('echarts-records'), 'walden'); - var myChart = echarts.init(document.getElementById('result'),'walden'); + var myChart = echarts.init(document.getElementById('result')); myChart.hideLoading(); myChart.showLoading(); @@ -867,6 +867,7 @@ } var option = { + theme: 'shine', xAxis: { name: '时间', type: 'category', @@ -966,6 +967,7 @@ + @* *@ @*
  • 重要数据趋势
  • 其他数据趋势
  • diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportController.cs b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportController.cs index 1a83092..b8391a5 100644 --- a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportController.cs +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportController.cs @@ -88,7 +88,7 @@ namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers { var listgroup = _realTimeIOState.GetIOGroup(systemDescription); var listinfo = _realTimeIOState.GetIOInfo(systemDescription); - var data = _realTimeIOState.GetRtData(); + var data = _realTimeIOState.GetRtData(systemDescription); return Content(data.Result); } } diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportNewController.cs b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportNewController.cs index 1481e68..9b66760 100644 --- a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportNewController.cs +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiJMReportNewController.cs @@ -88,7 +88,7 @@ namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers { var listgroup = _realTimeIOState.GetIOGroup(systemDescription); var listinfo = _realTimeIOState.GetIOInfo(systemDescription); - var data = _realTimeIOState.GetRtData(); + var data = _realTimeIOState.GetRtData(systemDescription); return Content(data.Result); } } diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateController.cs b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateController.cs index c75729f..1e4f3aa 100644 --- a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateController.cs +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateController.cs @@ -88,7 +88,7 @@ namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers { var listgroup = _realTimeIOState.GetIOGroup(systemDescription); var listinfo = _realTimeIOState.GetIOInfo(systemDescription); - var data = _realTimeIOState.GetRtData(); + var data = _realTimeIOState.GetRtData(systemDescription); return Content(data.Result); } } diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateControllerNew.cs b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateControllerNew.cs index 5b190a6..8dda7a3 100644 --- a/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateControllerNew.cs +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Controllers/PenMeiNetWorkStateControllerNew.cs @@ -32,24 +32,7 @@ namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers { return await Task.Run(() => { - /* - * 一 - * 1、安装java集成开发环境,根据示例重构jimu报表的代码。 - * 2、jimu报表的java环境继承到.Net中过于繁琐和前端功能较简单放弃使用jumu报表,使用另一款.Net作为服务端的cell报表。 - * 二 - * 1、下载cell报表前端源码,安装前端Vue3源码环境,通过反编译补全功能代码和与后端的Api请求。 - * 2、去除无用功能和界面,只保留报表功能,将所有原项目logo和名称标记替换为恒拓相关。 - * 三 - * 1、获取cellreport后端源码,编辑源码库的静态资源,下载补全项目引用的开源类库。 - * 2、修改水印函数库文件,将唯一不可修改的导出pdf水印替换为空或恒拓环保科技。 - * 四 - * 1、将前端和后端源码编译打包,重构项目运行结构,前后端集成为一个服务实力,部署测试。 - * 2、报表软件交给曲工进行报表编辑和运行测试,同时进行debug调试。 - * 五 - * 1、将曲工编辑好的报表集成至管理平台。 - * 2、比较JS自动绘图组件,选择适合自动生成的组件进行io模块自动构建。 - */ - //windows环境 + var computer = ComputerHelper.GetComputerInfo(); var arm = computer.RAMRate; var cpu = computer.CPURate; @@ -75,6 +58,13 @@ namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers return Content(listgroup.ToJson()); } + [HttpPost] + public async Task GetRealIOGroupForId(string[] IOGroupid) + { + var listgroup = _realTimeIOState.GetIOGroup(systemDescription, IOGroupid[0]); + + return Content(listgroup.ToJson()); + } [HttpGet] public async Task GetRealIOInfo() { @@ -83,12 +73,36 @@ namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers return Content(listinfo.ToJson()); } + [HttpPost] + public async Task GetRealIOInfoForId(string[] IOGroupid) + { + + var listinfo = _realTimeIOState.GetIOInfo(systemDescription, IOGroupid[0]); + + return Content(listinfo.ToJson()); + } + [HttpGet] + public async Task GetRealDevNetWork() + { + + var listinfo = _realTimeIOState.GetRealDevNetWork(systemDescription); + + return Content(listinfo.ToJson()); + } + [HttpGet] + public async Task GetDevNetWork() + { + + var listinfo = _realTimeIOState.GetDevNetWork(systemDescription); + + return Content(listinfo.ToJson()); + } [HttpGet] public async Task GetRealIOState() { - var listgroup = _realTimeIOState.GetIOGroup(systemDescription); - var listinfo = _realTimeIOState.GetIOInfo(systemDescription); - var data = _realTimeIOState.GetRtData(); + //var listgroup = _realTimeIOState.GetIOGroup(systemDescription); + //var listinfo = _realTimeIOState.GetIOInfo(systemDescription); + var data = _realTimeIOState.GetRtData(systemDescription); return Content(data.Result); } } diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiJMReportNew/Index - 副本.cshtml b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiJMReportNew/Index - xxback.cshtml similarity index 100% rename from HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiJMReportNew/Index - 副本.cshtml rename to HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiJMReportNew/Index - xxback.cshtml diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiJMReportNew/Index - 复制.cshtml b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiJMReportNew/Index - 复制.cshtml new file mode 100644 index 0000000..de9c474 --- /dev/null +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiJMReportNew/Index - 复制.cshtml @@ -0,0 +1,3226 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env + + + + + + +
    +
    +
    + +
    +
    +
    diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - xxback.cshtml b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - xxback.cshtml new file mode 100644 index 0000000..1d83503 --- /dev/null +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - xxback.cshtml @@ -0,0 +1,2818 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env + + + + + + +
    +
    +
    +
    +
    +
    diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - xxback2.cshtml b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - xxback2.cshtml new file mode 100644 index 0000000..ff74b40 --- /dev/null +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - xxback2.cshtml @@ -0,0 +1,4242 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env + + + + + + +
    +
    +
    +
    +
    +
    diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - 复制.cshtml b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - 复制.cshtml new file mode 100644 index 0000000..d72e179 --- /dev/null +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index - 复制.cshtml @@ -0,0 +1,4482 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env + + + + + + +
    +
    +
    +
    +
    +
    diff --git a/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index.cshtml b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index.cshtml index 1d83503..3a9fb82 100644 --- a/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index.cshtml +++ b/HT.Cloud.Web/Areas/PenMeiReportManage/Views/PenMeiNetWorkStateNew/Index.cshtml @@ -168,9 +168,9 @@ element = layui.element, echarts = layui.echarts; wcLoading.close(); - - const fShow = true; + + const fShow = false; const tShow = false; @@ -255,16 +255,22 @@ var b11 = true; var b12 = true; - var b13 = true; + var b13 = false; var b14 = false; var b21 = true; var b31 = true; var b32 = true; - var b33 = true; + var b33 = false; var b34 = true; var b35 = false; - if (tShow) { + var b41 = true; + var b42 = true; + var b43 = true; + var b44 = true; + var b45 = true; + + if (tShow) { const t11 = new LeaferUI.Line({ id: 'line11', points: [350 + 75, 210, 875, 310], @@ -358,43 +364,57 @@ }) group.add(false35) } - const image_disk = new LeaferUI.Image({ - x: 350, + + var devlist = []; + devajax = $.ajax({ + url: "/PenMeiReportManage/PenMeiNetWorkStateNew/GetDevNetWork", + type: "Get", + dataType: "json", + async: false, + success: function (redata) { + devlist = redata.Result; + } + }); + + var dev1att = devlist.filter(item => item.DeviceName === "dev1")[0]; + const image_appserver = new LeaferUI.Image({ + id: "dev1", + x: 200, y: 35, - url: '/imagesnet/面板.png', + url: '/imagesnet/应用服务器.png', draggable: draggable_dev, width: 134, height: 160, }) - var image_disk_name = new LeaferUI.Text({ - x: 350, + var image_appserver_name = new LeaferUI.Text({ + x: 200, y: 35 + 140 + 10, width: 134, fill: fill_top_name, - text: '数据大屏', + text: dev1att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_disk_name) - var image_disk_address = new LeaferUI.Text({ - x: 350, + group.add(image_appserver_name) + var image_appserver_address = new LeaferUI.Text({ + x: 200, y: 35 + 140 + 25, width: 134, fill: fill_top_name, - text: '192.168.100.130', + text: dev1att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_disk_address) + group.add(image_appserver_address) const line11 = new LeaferUI.Line({ - id: 'line11', - points: [350+75, 210, 875, 310], + id: 'line_' + dev1att.DeviceName, + points: [200 + 75, 210, 875, 310], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -406,57 +426,182 @@ } }) group.add(line11); - var line11_name = new LeaferUI.Text({ - x: (875-350-75)/2+350+75, - y: (310-210)/2+210, - width: 50, - fill: fill_top_name, - text: 'EL01', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line11_name); + // var line11_name = new LeaferUI.Text({ + // x: (875-200-75)/2+350+75, + // y: (310-210)/2+210, + // width: 50, + // fill: fill_top_name, + // text: 'EL01', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line11_name); - const image_appserver = new LeaferUI.Image({ - x: 650, + // const image_appserver = new LeaferUI.Image({ + // x: 650, + // y: 35, + // url: '/imagesnet/应用服务器.png', + // draggable: draggable_dev, + // width: 134, + // height: 160, + // }) + // var image_appserver_name = new LeaferUI.Text({ + // x: 650, + // y: 35 + 140 + 10, + // width: 134, + // fill: fill_top_name, + // text: '管理系统', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_appserver_name) + // var image_appserver_address = new LeaferUI.Text({ + // x: 650, + // y: 35 + 140 + 25, + // width: 134, + // fill: fill_top_name, + // text: '192.168.100.247', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_appserver_address) + // const line12 = new LeaferUI.Line({ + // id: 'line12', + // points: [650 + 75, 210, 875, 310], + // strokeWidth: 2, + // stroke: '#cecece', + // shadow: { + // x: 0, + // y: 0, + // blur: 1, + // color: '#cecece', + // visible: true, + // } + // }) + // group.add(line12); + // var line12_name = new LeaferUI.Text({ + // x: (875 - 650 - 75) / 2 + 650 + 75, + // y: (310 - 210) / 2 + 210, + // width: 50, + // fill: fill_top_name, + // text: 'EL02', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line12_name); + + // const image_appserver3d = new LeaferUI.Image({ + // x: 950, + // y: 35, + // url: '/imagesnet/应用服务器.png', + // draggable: draggable_dev, + // width: 134, + // height: 160, + // }) + // var image_3d_name = new LeaferUI.Text({ + // x: 950, + // y: 35 + 140 + 10, + // width: 134, + // fill: fill_top_name, + // text: '3D可视化系统', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_3d_name) + // var image_3d_address = new LeaferUI.Text({ + // x: 950, + // y: 35 + 140 + 25, + // width: 134, + // fill: fill_top_name, + // text: '192.168.100.220', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_3d_address) + // const line13 = new LeaferUI.Line({ + // id: 'line13', + // points: [950 + 75, 210, 875, 310], + // strokeWidth: 2, + // stroke: '#cecece', + // shadow: { + // x: 0, + // y: 0, + // blur: 1, + // color: '#cecece', + // visible: true, + // } + // }) + // group.add(line13); + // var line13_name = new LeaferUI.Text({ + // x: (950 + 75 - 875) / 2 + 875, + // y: (310 - 210) / 2 + 210, + // width: 50, + // fill: fill_top_name, + // text: 'EL03', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line13_name); + var dev2att = devlist.filter(item => item.DeviceName === "dev2")[0]; + const image_appserver3d = new LeaferUI.Image({ + id: "dev2", + x: 800, y: 35, url: '/imagesnet/应用服务器.png', draggable: draggable_dev, width: 134, height: 160, }) - var image_appserver_name = new LeaferUI.Text({ - x: 650, + var image_3d_name = new LeaferUI.Text({ + x: 800, y: 35 + 140 + 10, width: 134, fill: fill_top_name, - text: '管理系统', + text: dev2att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_appserver_name) - var image_appserver_address = new LeaferUI.Text({ - x: 650, + group.add(image_3d_name) + var image_3d_address = new LeaferUI.Text({ + x: 800, y: 35 + 140 + 25, width: 134, fill: fill_top_name, - text: '192.168.100.247', + text: dev2att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_appserver_address) + group.add(image_3d_address) const line12 = new LeaferUI.Line({ - id: 'line12', - points: [650 + 75, 210, 875, 310], + id: 'line_' + dev2att.DeviceName, + points: [800 + 75, 210, 875, 310], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -468,57 +613,58 @@ } }) group.add(line12); - var line12_name = new LeaferUI.Text({ - x: (875 - 650 - 75) / 2 + 650 + 75, - y: (310 - 210) / 2 + 210, - width: 50, - fill: fill_top_name, - text: 'EL02', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line12_name); - - const image_appserver3d = new LeaferUI.Image({ - x: 950, + // var line12_name = new LeaferUI.Text({ + // x: (800 + 75 - 875) / 2 + 875, + // y: (310 - 210) / 2 + 210, + // width: 50, + // fill: fill_top_name, + // text: 'EL04', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line12_name); + var dev9att = devlist.filter(item => item.DeviceName === "dev9")[0]; + const image_computer = new LeaferUI.Image({ + id: "dev9", + x: 1400, y: 35, - url: '/imagesnet/应用服务器.png', + url: '/imagesnet/计算机.png', draggable: draggable_dev, width: 134, height: 160, }) - var image_3d_name = new LeaferUI.Text({ - x: 950, + var image_computer_name = new LeaferUI.Text({ + x: 1400, y: 35 + 140 + 10, width: 134, fill: fill_top_name, - text: '3D可视化系统', + text: dev9att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_3d_name) - var image_3d_address = new LeaferUI.Text({ - x: 950, + group.add(image_computer_name) + var image_computer_address = new LeaferUI.Text({ + x: 1400, y: 35 + 140 + 25, width: 134, fill: fill_top_name, - text: '192.168.100.220', + text: dev9att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_3d_address) + group.add(image_computer_address) const line13 = new LeaferUI.Line({ - id: 'line13', - points: [950 + 75, 210, 875, 310], + id: 'line_' + dev9att.DeviceName, + points: [1400 + 75, 210, 875, 310], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -530,85 +676,25 @@ } }) group.add(line13); - var line13_name = new LeaferUI.Text({ - x: (950 + 75 - 875) / 2 + 875, - y: (310 - 210) / 2 + 210, - width: 50, - fill: fill_top_name, - text: 'EL03', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line13_name); + // var line13_name = new LeaferUI.Text({ + // x: (1400 + 75 - 875) / 2 + 875, + // y: (310 - 210) / 2 + 210, + // width: 50, + // fill: fill_top_name, + // text: 'EL10', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line13_name); + - const image_appserver2d = new LeaferUI.Image({ - x: 1250, - y: 35, - url: '/imagesnet/应用服务器.png', - draggable: draggable_dev, - width: 134, - height: 160, - }) - var image_2d_name = new LeaferUI.Text({ - x: 1250, - y: 35 + 140 + 10, - width: 134, - fill: fill_top_name, - text: '2D可视化系统', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(image_2d_name) - var image_2d_address = new LeaferUI.Text({ - x: 1250, - y: 35 + 140 + 25, - width: 134, - fill: fill_top_name, - text: '192.168.100.230', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(image_2d_address) - const line14 = new LeaferUI.Line({ - id: 'line14', - points: [1250 + 75, 210, 875, 310], - strokeWidth: 2, - stroke: '#cecece', - shadow: { - x: 0, - y: 0, - blur: 1, - color: '#cecece', - visible: true, - } - }) - group.add(line14); - var line14_name = new LeaferUI.Text({ - x: (1250 + 75 - 875) / 2 + 875, - y: (310 - 210) / 2 + 210, - width: 50, - fill: fill_top_name, - text: 'EL04', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line14_name); const image_exchange = new LeaferUI.Image({ x: 800, - y: 250+75, + y: 250 + 75, url: '/imagesnet/交换机.png', draggable: draggable_dev, width: 134, @@ -641,83 +727,84 @@ }) group.add(image_exchange_address) - const image_server = new LeaferUI.Image({ - x: 1300, - y: 75 + 250, - url: '/imagesnet/服务器.png', - draggable: draggable_dev, - width: 134, - height: 160, - }) - var image_server_name = new LeaferUI.Text({ - x: 1300, - y: 75 + 250 + 140 + 10, - width: 134, - fill: fill_top_name, - text: 'L2服务器', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(image_server_name) - var image_server_address = new LeaferUI.Text({ - x: 1300, - y: 75 + 250 + 140 + 25, - width: 134, - fill: fill_top_name, - text: '192.168.100.15', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(image_server_address) - const line21 = new LeaferUI.Line({ - id: 'line21', - points: [1300, 400, 945, 400], - strokeWidth: 2, - stroke: '#cecece', - shadow: { - x: 0, - y: 0, - blur: 1, - color: '#cecece', - visible: true, - } - }) - group.add(line21); - var line21_name = new LeaferUI.Text({ - x: (1300-945) / 2 + 945, - y: (400-400) / 2 + 400, - width: 50, - fill: fill_top_name, - text: 'EL05', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line21_name); + // const image_server = new LeaferUI.Image({ + // x: 1300, + // y: 75 + 250, + // url: '/imagesnet/服务器.png', + // draggable: draggable_dev, + // width: 134, + // height: 160, + // }) + // var image_server_name = new LeaferUI.Text({ + // x: 1300, + // y: 75 + 250 + 140 + 10, + // width: 134, + // fill: fill_top_name, + // text: 'L2服务器', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_server_name) + // var image_server_address = new LeaferUI.Text({ + // x: 1300, + // y: 75 + 250 + 140 + 25, + // width: 134, + // fill: fill_top_name, + // text: '192.168.100.15', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_server_address) + // const line21 = new LeaferUI.Line({ + // id: 'line21', + // points: [1300, 400, 945, 400], + // strokeWidth: 2, + // stroke: '#cecece', + // shadow: { + // x: 0, + // y: 0, + // blur: 1, + // color: '#cecece', + // visible: true, + // } + // }) + // group.add(line21); + // var line21_name = new LeaferUI.Text({ + // x: (1300-945) / 2 + 945, + // y: (400-400) / 2 + 400, + // width: 50, + // fill: fill_top_name, + // text: 'EL05', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line21_name); - + var dev3att = devlist.filter(item => item.DeviceName === "dev3")[0]; const image_PLC = new LeaferUI.Image({ - x: 200, + id: "dev3", + x: 800, y: 150 + 500, url: '/imagesnet/PLC.png', draggable: draggable_dev, - width:134, + width: 134, height: 160, }) var image_PLC_name = new LeaferUI.Text({ - x: 200, + x: 800, y: 150 + 500 + 140 + 10, width: 134, fill: fill_top_name, - text: 'S7 400', + text: dev3att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', @@ -726,11 +813,11 @@ }) group.add(image_PLC_name) var image_PLC_address = new LeaferUI.Text({ - x: 200, + x: 800, y: 150 + 500 + 140 + 25, width: 134, fill: fill_top_name, - text: '192.168.100.10', + text: dev3att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', @@ -739,8 +826,8 @@ }) group.add(image_PLC_address) const line31 = new LeaferUI.Line({ - id: 'line31', - points: [200 + 75, 650, 875, 520], + id: 'line_' + dev3att.DeviceName, + points: [800 + 75, 650, 875, 520], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -752,58 +839,250 @@ } }) group.add(line31); - var line31_name = new LeaferUI.Text({ - x: (875-200-75) / 2 + 200+75, - y: (650 - 520) / 2 + 520, - width: 50, - fill: fill_top_name, - text: 'EL06', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line31_name); + // var line31_name = new LeaferUI.Text({ + // x: (875 - 800 - 75) / 2 + 500 + 75, + // y: (650 - 520) / 2 + 520, + // width: 50, + // fill: fill_top_name, + // text: 'EL06', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line31_name); - const image_PLC2 = new LeaferUI.Image({ - x: 500, - y: 150 + 500, + // const image_PLC2 = new LeaferUI.Image({ + // id: "dev4", + // x: 800, + // y: 150 + 500, + // url: '/imagesnet/PLC.png', + // draggable: draggable_dev, + // width: 134, + // height: 160, + // }) + // var image_PLC2_name = new LeaferUI.Text({ + // x: 800, + // y: 150 + 500+140+10, + // width: 134, + // fill: fill_top_name, + // text: 'S7 300 磨机', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_PLC2_name) + // var image_PLC2_address = new LeaferUI.Text({ + // x: 800, + // y: 150 + 500 + 140 + 25, + // width: 134, + // fill: fill_top_name, + // text: '192.168.100.20', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_PLC2_address) + // const line32 = new LeaferUI.Line({ + // id: 'line32', + // points: [800 + 75, 650, 875, 520], + // // points: [334, 725, 500, 725], + // strokeWidth: 2, + // stroke: '#cecece', + // shadow: { + // x: 0, + // y: 0, + // blur: 1, + // color: '#cecece', + // visible: true, + // } + // }) + // group.add(line32); + // var line32_name = new LeaferUI.Text({ + // x: (875 - 800 - 75) / 2 + 500 + 75, + // y: (650 - 520) / 2 + 520, + // width: 50, + // fill: fill_top_name, + // text: 'EL07', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line32_name); + + // const image_et = new LeaferUI.Image({ + // id: "dev5", + // x: 1400, + // y: 150 + 500, + // url: '/imagesnet/PLC.png', + // draggable: draggable_dev, + // width: 134, + // height: 160, + // }) + // var image_et_name = new LeaferUI.Text({ + // x: 1400, + // y: 150 + 500 + 140 + 10, + // width: 134, + // fill: fill_top_name, + // text: 'S7 300 电气', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_et_name) + // var image_et_address = new LeaferUI.Text({ + // x: 1400, + // y: 150 + 500 + 140 + 25, + // width: 134, + // fill: fill_top_name, + // text: '192.168.100.130', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_et_address) + // const line33 = new LeaferUI.Line({ + // id: 'line33', + // points: [1400 + 75, 650, 875, 520], + // // points: [634, 725, 800, 725], + // strokeWidth: 2, + // stroke: '#cecece', + // shadow: { + // x: 0, + // y: 0, + // blur: 1, + // color: '#cecece', + // visible: true, + // } + // }) + // group.add(line33); + // var line33_name = new LeaferUI.Text({ + // x: 875, + // y: (650 - 520) / 2 + 520, + // width: 50, + // fill: fill_top_name, + // text: 'EL08', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line33_name); + + // const image_et2 = new LeaferUI.Image({ + // x: 1100, + // y: 150 + 500, + // url: '/imagesnet/PLC.png', + // draggable: draggable_dev, + // width: 134, + // height: 160, + // }) + // var image_et2_name = new LeaferUI.Text({ + // x: 1100, + // y: 150 + 500 + 140 + 10, + // width: 134, + // fill: fill_top_name, + // text: 'S7 300 电气', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_et2_name) + // var image_et2_address = new LeaferUI.Text({ + // x: 1100, + // y: 150 + 500 + 140 + 25, + // width: 134, + // fill: fill_top_name, + // text: '192.168.100.140', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(image_et2_address) + // const line34 = new LeaferUI.Line({ + // id: 'line34', + // points: [1100 + 75, 650, 875, 520], + // strokeWidth: 2, + // stroke: '#cecece', + // shadow: { + // x: 0, + // y: 0, + // blur: 1, + // color: '#cecece', + // visible: true, + // } + // }) + // group.add(line34); + // var line34_name = new LeaferUI.Text({ + // x: (1100+75-875) / 2 + 875, + // y: (650 - 520) / 2 + 520, + // width: 50, + // fill: fill_top_name, + // text: 'EL09', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line34_name); + var dev4att = devlist.filter(item => item.DeviceName === "dev4")[0]; + const image_cet1 = new LeaferUI.Image({ + id: "dev4", + x: 200, + y: 150 + 500 + 250, url: '/imagesnet/PLC.png', draggable: draggable_dev, width: 134, height: 160, }) - var image_PLC2_name = new LeaferUI.Text({ - x: 500, - y: 150 + 500+140+10, + var image_cet1_name = new LeaferUI.Text({ + x: 200, + y: 150 + 500 + 140 + 10 + 250, width: 134, fill: fill_top_name, - text: '子站#1 ET200', + text: dev4att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_PLC2_name) - var image_PLC2_address = new LeaferUI.Text({ - x: 500, - y: 150 + 500 + 140 + 25, + group.add(image_cet1_name) + var image_cet1_address = new LeaferUI.Text({ + x: 200, + y: 150 + 500 + 140 + 25 + 250, width: 134, fill: fill_top_name, - text: '192.168.100.20', + text: dev4att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_PLC2_address) - const line32 = new LeaferUI.Line({ - id: 'line32', - //points: [500 + 75, 650, 875, 520], - points: [334, 725, 500, 725], + group.add(image_cet1_address) + const line41 = new LeaferUI.Line({ + id: 'line_' + dev4att.DeviceName, + points: [200 + 75, 650 + 250, 875, 520 + 300], + //[-200 + 75, 650, 875, 520], + // points: [634, 725, 800, 725], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -814,59 +1093,61 @@ visible: true, } }) - group.add(line32); - var line32_name = new LeaferUI.Text({ - x: (500-334) / 2 + 334, - y: (725-725) / 2 + 725-5, - width: 50, - fill: fill_top_name, - text: 'EL07', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line32_name); - - const image_et = new LeaferUI.Image({ - x: 800, - y: 150 + 500, + group.add(line41); + // var line41_name = new LeaferUI.Text({ + // x: -200+75, + // y: (650+250 - 520 -300) / 2 + 520+300, + // width: 50, + // fill: fill_top_name, + // text: 'EL09', + // textAlign: 'center', + // verticalAlign: 'middle', + // textWrap: 'none', + // padding: 0, + // fontSize: 12 + // }) + // group.add(line41_name); + var dev5att = devlist.filter(item => item.DeviceName === "dev5")[0]; + const image_cet2 = new LeaferUI.Image({ + id: "dev5", + x: 500, + y: 150 + 500 + 250, url: '/imagesnet/PLC.png', draggable: draggable_dev, width: 134, height: 160, }) - var image_et_name = new LeaferUI.Text({ - x: 800, - y: 150 + 500 + 140 + 10, + var image_cet2_name = new LeaferUI.Text({ + x: 500, + y: 150 + 500 + 140 + 10 + 250, width: 134, fill: fill_top_name, - text: '子站#2 ET200', + text: dev5att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_et_name) - var image_et_address = new LeaferUI.Text({ - x: 800, - y: 150 + 500 + 140 + 25, + group.add(image_cet2_name) + var image_cet2_address = new LeaferUI.Text({ + x: 500, + y: 150 + 500 + 140 + 25 + 250, width: 134, fill: fill_top_name, - text: '192.168.100.130', + text: dev5att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_et_address) - const line33 = new LeaferUI.Line({ - id: 'line33', - //points: [800 + 75, 650, 875, 520], - points: [634, 725, 800, 725], + group.add(image_cet2_address) + const line42 = new LeaferUI.Line({ + id: 'line_' + dev5att.DeviceName, + points: [500 + 75, 650 + 250, 875, 520 + 300], + //[-200 + 75, 650, 875, 520], + // points: [634, 725, 800, 725], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -877,58 +1158,48 @@ visible: true, } }) - group.add(line33); - var line33_name = new LeaferUI.Text({ - x: (800 - 634) / 2 + 634, - y: (725 - 725) / 2 + 725-5, - width: 50, - fill: fill_top_name, - text: 'EL08', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line33_name); - - const image_et2 = new LeaferUI.Image({ - x: 1100, - y: 150 + 500, + group.add(line42); + var dev6att = devlist.filter(item => item.DeviceName === "dev6")[0]; + const image_cet3 = new LeaferUI.Image({ + id: "dev6", + x: 800, + y: 150 + 500 + 250, url: '/imagesnet/PLC.png', draggable: draggable_dev, width: 134, height: 160, }) - var image_et2_name = new LeaferUI.Text({ - x: 1100, - y: 150 + 500 + 140 + 10, + var image_cet3_name = new LeaferUI.Text({ + x: 800, + y: 150 + 500 + 140 + 10 + 250, width: 134, fill: fill_top_name, - text: 'S7 300', + text: dev6att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_et2_name) - var image_et2_address = new LeaferUI.Text({ - x: 1100, - y: 150 + 500 + 140 + 25, + group.add(image_cet3_name) + var image_cet3_address = new LeaferUI.Text({ + x: 800, + y: 150 + 500 + 140 + 25 + 250, width: 134, fill: fill_top_name, - text: '192.168.100.140', + text: dev6att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_et2_address) - const line34 = new LeaferUI.Line({ - id: 'line34', - points: [1100 + 75, 650, 875, 520], + group.add(image_cet3_address) + const line43 = new LeaferUI.Line({ + id: 'line_' + dev6att.DeviceName, + points: [800 + 75, 650 + 250, 875, 520 + 300], + //[-200 + 75, 650, 875, 520], + // points: [634, 725, 800, 725], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -939,58 +1210,48 @@ visible: true, } }) - group.add(line34); - var line34_name = new LeaferUI.Text({ - x: (1100+75-875) / 2 + 875, - y: (650 - 520) / 2 + 520, - width: 50, - fill: fill_top_name, - text: 'EL09', - textAlign: 'center', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - group.add(line34_name); - - const image_computer = new LeaferUI.Image({ - x: 1400, - y: 150 + 500, - url: '/imagesnet/计算机.png', + group.add(line43); + var dev7att = devlist.filter(item => item.DeviceName === "dev7")[0]; + const image_cet4 = new LeaferUI.Image({ + id: "dev7", + x: 1100, + y: 150 + 500 + 250, + url: '/imagesnet/PLC.png', draggable: draggable_dev, width: 134, height: 160, }) - var image_computer_name = new LeaferUI.Text({ - x: 1400, - y: 150 + 500 + 140 + 10, + var image_cet4_name = new LeaferUI.Text({ + x: 1100, + y: 150 + 500 + 140 + 10 + 250, width: 134, fill: fill_top_name, - text: 'WINCC上位机', + text: dev7att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_computer_name) - var image_computer_address = new LeaferUI.Text({ - x: 1400, - y: 150 + 500 + 140 + 25, + group.add(image_cet4_name) + var image_cet4_address = new LeaferUI.Text({ + x: 1100, + y: 150 + 500 + 140 + 25 + 250, width: 134, fill: fill_top_name, - text: '192.168.100.50', + text: dev7att.DeviceIP, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(image_computer_address) - const line35 = new LeaferUI.Line({ - id: 'line35', - points: [1400 + 75, 650, 875, 520], + group.add(image_cet4_address) + const line44 = new LeaferUI.Line({ + id: 'line_' + dev7att.DeviceName, + points: [1100 + 75, 650 + 250, 875, 520 + 300], + //[-200 + 75, 650, 875, 520], + // points: [634, 725, 800, 725], strokeWidth: 2, stroke: '#cecece', shadow: { @@ -1001,39 +1262,80 @@ visible: true, } }) - group.add(line35); - var line35_name = new LeaferUI.Text({ - x: (1400 + 75 - 875) / 2 + 875, - y: (650 - 520) / 2 + 520, - width: 50, + group.add(line44); + var dev8att = devlist.filter(item => item.DeviceName === "dev8")[0]; + const image_cet5 = new LeaferUI.Image({ + id: "dev8", + x: 1400, + y: 150 + 500 + 250, + url: '/imagesnet/PLC.png', + draggable: draggable_dev, + width: 134, + height: 160, + }) + var image_cet5_name = new LeaferUI.Text({ + x: 1400, + y: 150 + 500 + 140 + 10 + 250, + width: 134, fill: fill_top_name, - text: 'EL10', + text: dev8att.DeviceDESCRIPTION, textAlign: 'center', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - group.add(line35_name); - - + group.add(image_cet5_name) + var image_cet5_address = new LeaferUI.Text({ + x: 1400, + y: 150 + 500 + 140 + 25 + 250, + width: 134, + fill: fill_top_name, + text: dev8att.DeviceIP, + textAlign: 'center', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + group.add(image_cet5_address) + const line45 = new LeaferUI.Line({ + id: 'line_' + dev8att.DeviceName, + points: [1400 + 75, 650 + 250, 875, 520 + 300], + //[-200 + 75, 650, 875, 520], + // points: [634, 725, 800, 725], + strokeWidth: 2, + stroke: '#cecece', + shadow: { + x: 0, + y: 0, + blur: 1, + color: '#cecece', + visible: true, + } + }) + group.add(line45); //group.add(image_cpu) group.add(image_PLC) - group.add(image_et) - group.add(image_PLC2) - group.add(image_et2) - group.add(image_disk) + // group.add(image_et) + // group.add(image_PLC2) + // group.add(image_et2) + // group.add(image_disk) //group.add(image_valve) - group.add(image_server) + // group.add(image_server) group.add(image_exchange) group.add(image_computer) group.add(image_appserver) - group.add(image_appserver2d) + // group.add(image_appserver2d) group.add(image_appserver3d) - + group.add(image_cet1) + group.add(image_cet2) + group.add(image_cet3) + group.add(image_cet4) + group.add(image_cet5) //32IO配置项 const top_row_height_32bit = 25; @@ -1246,32 +1548,40 @@ const io_rect_name_right_width_cm = 40; const io_rect_description_right_width_cm = 110; - const groupio = new LeaferUI.Group({ x: 0, y: 0, scaleX: 1, scaleY: 1 }) - - var iogroupio = []; - var ioinfo = []; - groupioajax = $.ajax({ - url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOgroup", - type: "Get", - dataType: "json", - async: false, - success: function (redata) { - iogroupio = redata.Result; - } - }); - infoajax = $.ajax({ - url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOInfo", - type: "Get", - dataType: "json", - async: false, - success: function (redata) { - ioinfo = redata.Result; - } - }); - debugger; + const groupiolist = []; + + // const groupio = new LeaferUI.Group({ x: 0, y: 0, scaleX: 1, scaleY: 1 }) + + + // var iogroupio = []; + // var ioinfo = []; + + var tags = []; + // groupioajax = $.ajax({ + // url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOgroup", + // type: "Get", + // dataType: "json", + // async: false, + // success: function (redata) { + // iogroupio = redata.Result; + // } + // }); + // infoajax = $.ajax({ + // url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOInfo", + // type: "Get", + // dataType: "json", + // async: false, + // success: function (redata) { + // ioinfo = redata.Result; + // } + // }); + + + // var ddddd = devlist.filter(item => item.DeviceName === "dev1")[0].DeviceIP; + // debugger; const top_text_value_array_32bitt = ['DQ 32xDC 24V/0.5A HF', 'Slot: 1', '在线'];//右上右下 const name_32bitt = ['DQ0.0', 'DQ0.1', 'DQ0.2', 'DQ0.3', 'DQ0.4', 'DQ0.5', 'DQ0.6', 'DQ0.7', 'DQ1.0', 'DQ1.1', 'DQ1.2', 'DQ1.3', 'DQ1.4', 'DQ1.5', 'DQ1.6', 'DQ1.7', 'DQ2.0', 'DQ2.1', 'DQ2.2', 'DQ2.3', 'DQ2.4', 'DQ2.5', 'DQ2.6', 'DQ2.7', 'DQ3.0', 'DQ3.1', 'DQ3.2', 'DQ3.3', 'DQ3.4', 'DQ3.5', 'DQ3.6', 'DQ3.7',]; @@ -1289,1388 +1599,2875 @@ const name_eth_cm_ = ['ETH1', 'ETH2']; const descriptions_eth_cm_ = ['10/100 Mbit/s', '10/100 Mbit/s']; - iogroupio.sort(function (a, b) { - return a.IOSlot - b.IOSlot; // 从小到大排序 - }); - debugger; - var initx = 452; - for (var i = 0; i < iogroupio.length; i++) { - var iobit = iogroupio[i].IOBit; - var ioid = iogroupio[i].IOID; - var top_text_value_array = [iogroupio[i].IOModel, 'Slot: ' + iogroupio[i].IOSlot, "在线"] - var ioinfofilter = ioinfo.filter(function (item) { - return item.IOID === ioid; + for (var id = 0; id < devlist.length; id++) { + if (devlist[id].DeviceIncludeModel == "0") { + continue; + } + const groupio = new LeaferUI.Group({ x: 0, y: 0, scaleX: 1, scaleY: 1, id: devlist[id].DeviceName + '_IOBox' }) + var devtaglist = []; + var diolist = []; + var aiolist = []; + var groupid = devlist[id].DeviceIOGroupID; + let iogroupio = []; + groupioajax = $.ajax({ + url: "/PenMeiReportManage/PenMeiNetWorkStateNew/GetRealIOGroupForId", + type: "Post", + data: { IOGroupid: groupid }, + // dataType: "json", + async: false, + success: function (redata) { + iogroupio = JSON.parse(redata).Result; + } }); - var names = []; - var descriptions = []; - for (var iff = 0; iff < ioinfofilter.length; iff++) { - names.push(ioinfofilter[iff].IONAME) - descriptions.push(ioinfofilter[iff].IODESCRIPTION) + + let ioinfo = []; + infoioajax = $.ajax({ + url: "/PenMeiReportManage/PenMeiNetWorkStateNew/GetRealIOInfoForId", + type: "Post", + data: { IOGroupid: groupid }, + // dataType: "json", + async: false, + success: function (redata) { + ioinfo = JSON.parse(redata).Result; + } + }); + $.when(groupioajax).done(); + $.when(infoioajax).done(); + + iogroupio.sort(function (a, b) { + return a.IOSlot - b.IOSlot; // 从小到大排序 + }); + // debugger; + var initx = 50;//452 + for (var i = 0; i < iogroupio.length; i++) { + var iotype = iogroupio[i].IOType; + var iobit = iogroupio[i].IOBit; + var ioid = iogroupio[i].IOID; + var top_text_value_array = [iogroupio[i].IOModel, 'Slot: ' + iogroupio[i].IOSlot, "在线"] + var ioinfofilter = ioinfo.filter(function (item) { + return item.IOID === ioid; + }); + var names = []; + var tagnames = []; + var descriptions = []; + for (var iff = 0; iff < ioinfofilter.length; iff++) { + names.push(ioinfofilter[iff].IONAME) + descriptions.push(ioinfofilter[iff].IODESCRIPTION) + tagnames.push(ioinfofilter[iff].IOTagName) + // devtaglist.push(ioinfofilter[iff].IOTagName) + } + + var ioboxwidth = 0; + //debugger; + if (iotype == 'Digital') { + diolist.push(...tagnames) + if (iobit == '32') { + ioboxwidth = 300; + var offset = 2; + initx = initx + offset + var box = Draw32bitIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } + else if (iobit == '16') { + ioboxwidth = 200; + var offset = 2; + initx = initx + offset + var box = Draw16bitIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } else if (iobit = '8') { + ioboxwidth = 200; + var offset = 2; + initx = initx + offset + var box = Draw8bitIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } + } else if (iotype == 'Analog') { + aiolist.push(...tagnames) + if (iobit == '32') { + ioboxwidth = 300; + var offset = 2; + initx = initx + offset + var box = Draw32bitAnalogIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } + else if (iobit == '16') { + ioboxwidth = 200; + var offset = 2; + initx = initx + offset + var box = Draw16bitAnalogIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } else if (iobit == '8') { + ioboxwidth = 200; + var offset = 2; + initx = initx + offset + var box = Draw8bitAnalogIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } else if (iobit == '4') { + debugger; + ioboxwidth = 200; + var offset = 2; + initx = initx + offset + var box = Draw4bitAnalogIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } else if (iobit == '2') { + debugger; + ioboxwidth = 200; + var offset = 2; + initx = initx + offset + var box = Draw2bitAnalogIOBox(names, tagnames, top_text_value_array, descriptions, ioboxwidth, initx) + initx = initx + ioboxwidth; + if (i == 0) { + DrawReturnBox(box) + } + groupio.add(box) + } + } + } + // var boxcpu = DrawCPUBox(name_cpu_, top_text_value_array_cpu_, descriptions_cpu_, name_eth_cpu_, descriptions_eth_cpu_, 200, 50) + // var boxcm = DrawCMBox(name_cm_, top_text_value_array_cm_, descriptions_cm_, name_eth_cm_, descriptions_eth_cm_, 200, 252) + // groupio.add(boxcpu); + // groupio.add(boxcm); - var ioboxwidth = 0; - //debugger; - if (iobit == '32') { - ioboxwidth = 300; - var offset = 2; - initx = initx + offset - var box = Draw32bitIOBox(names, top_text_value_array, descriptions, ioboxwidth, initx) - initx = initx + ioboxwidth; - groupio.add(box) - } - else if (iobit == '16') { - ioboxwidth = 200; - var offset = 2; - initx = initx + offset - var box = Draw16bitIOBox(names, top_text_value_array, descriptions, ioboxwidth, initx) - initx = initx + ioboxwidth; - groupio.add(box) - } else if (iobit = '8') { - ioboxwidth = 200; - var offset = 2; - initx = initx + offset - var box = Draw8bitIOBox(names, top_text_value_array, descriptions, ioboxwidth, initx) - initx = initx + ioboxwidth; - groupio.add(box) - } + function Draw32bitIOBox(name_32bit, tagname_32bit, top_text_value_array_32bit, descriptions_32bit, ioboxwidth, initx) { + var box_32bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) - } - var boxcpu = DrawCPUBox(name_cpu_, top_text_value_array_cpu_, descriptions_cpu_, name_eth_cpu_, descriptions_eth_cpu_, 200, 50) - var boxcm = DrawCMBox(name_cm_, top_text_value_array_cm_, descriptions_cm_, name_eth_cm_, descriptions_eth_cm_, 200, 252) - groupio.add(boxcpu); - groupio.add(boxcm); - - function Draw32bitIOBox(name_32bit, top_text_value_array_32bit, descriptions_32bit, ioboxwidth, initx) { - var box_32bit = new LeaferUI.Box({ - x: initx, - y: 20, - width: ioboxwidth, - height: height_iobox, - fill: fill_iobox, - draggable: draggable_dev, - strokeWidth: 1, - stroke: stroke_iobox, - }) - - var ylinex_sum_four = 0; - var ylinex_array_four = []; - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; - ylinex_array_four.push(ylinex_sum_four); + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } } - else if (linexid == 1) { - ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 2) { - ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 11) { - ylinex_sum_four = ylinex_sum_four + separator_32bit; - ylinex_array_four.push(ylinex_sum_four); - } - else { - ylinex_sum_four = ylinex_sum_four + io_row_height_32bit; - ylinex_array_four.push(ylinex_sum_four); - } - } - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_32bit.add(line); - } - else if (linexid == 1) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_32bit.add(line); - } - else if (linexid == 2) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_32bit.add(line); - } - else if (linexid == 11) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 20, - width: width_iobox, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_32bit.add(line); - } - else { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 45, - width: width_iobox, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_32bit.add(line); - } - //box_32bit.add(line); - } - - var spiltline_four = new LeaferUI.Line({ - x: width_iobox / 2, - y: top_row_height_32bit * 3, - width: height_iobox - top_row_height_32bit * 3, - rotation: 90, - stroke: stroke_iobox_spiltline, - strokeWidth: 1, - dashPattern: [5, 2] - }) - box_32bit.add(spiltline_four); - - - //box4左侧顶部状态效果 - for (var tid = 0; tid < 3; tid++) { - let y = io_row_y_offset_32bit + tid * top_row_height_32bit; - if (tid < 2) { - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_32bit, - y: y,//+10 - //height:10, - width: io_row_left_width_name_32bit, - fill: fill_top_name, - text: top_text_value_array_32bit[tid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - box_32bit.add(top_text_value) + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + //box_32bit.add(line); } - if (tid == 2) { - var rect = new LeaferUI.Rect({ - x: io_row_left_x_name_32bit, - y: y - 5, + var spiltline_four = new LeaferUI.Line({ + x: width_iobox / 2, + y: top_row_height_32bit * 3, + width: height_iobox - top_row_height_32bit * 3, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + box_32bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_32bit + tid * top_row_height_32bit; + if (tid < 2) { + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_32bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_32bit, + fill: fill_top_name, + text: top_text_value_array_32bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_32bit.add(top_text_value) + } + + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_32bit, + y: y - 5, + height: rect_height_32bit, + width: io_rect_left_width_32bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_32bit[1].replace(' ', '') + '_OnlineSatate' + }) + debugger; + box_32bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_32bit + io_rect_left_width_32bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_32bit, + fill: fill_top_name, + text: top_text_value_array_32bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_32bit.add(top_text_value) + } + + // var left_top_text_name = new LeaferUI.Text({ + // x:io_row_left_x_name_32bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_name_32bit, + // fill: fill_top_name, + // text:left_top_text_name_four_array_32bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var left_top_text_name_value = new LeaferUI.Text({ + // x:io_row_left_x_value_32bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_value_32bit, + // fill: fill_top_name_value, + // text:left_top_text_value_four_array_32bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // //建议取消 + // var right_top_text_name = new LeaferUI.Text({ + // x:io_row_right_x_name_32bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_name_32bit, + // fill: fill_top_name, + // text:right_top_text_name_four_array_32bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var right_top_text_name_value = new LeaferUI.Text({ + // x:io_row_right_x_name_32bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_value_32bit, + // fill: fill_top_name_value, + // text:right_top_text_value_four_array_32bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // box_32bit.add(left_top_text_name) + // //box_32bit.add(right_top_text_name) + // box_32bit.add(left_top_text_name_value) + // box_32bit.add(right_top_text_name_value) + } + + + //box4效果 + for (var sid = 0; sid < 16; sid++) { + let y = 0; + if (sid < 8) { + y = io_row_height_32bit * (sid) + rect_top_y_offset_32bit; + } + if (sid >= 8) { + y = io_row_height_32bit * (sid + 1) + rect_bottom_y_offset_32bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_32bit, + y: y + io_rect_left_y_offset_32bit, height: rect_height_32bit, width: io_rect_left_width_32bit, fill: fill_rect, draggable: false, - id: top_text_value_array_32bit[1].replace(' ', '') + '_OnlineSatate' + id: tagname_32bit[sid] }) - debugger; - box_32bit.add(rect) - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_32bit + io_rect_left_width_32bit + 15, - y: y,//+10 - //height:10, - width: io_row_left_width_name_32bit, - fill: fill_top_name, - text: top_text_value_array_32bit[tid], + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_name_left_width_32bit, + fill: fill_rect_text_name, + text: name_32bit[sid], textAlign: 'left', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - box_32bit.add(top_text_value) - } - - // var left_top_text_name = new LeaferUI.Text({ - // x:io_row_left_x_name_32bit, - // y:y,//+10 - // //height:10, - // width:io_row_left_width_name_32bit, - // fill: fill_top_name, - // text:left_top_text_name_four_array_32bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // var left_top_text_name_value = new LeaferUI.Text({ - // x:io_row_left_x_value_32bit, - // y:y,//+10 - // //height:10, - // width:io_row_left_width_value_32bit, - // fill: fill_top_name_value, - // text:left_top_text_value_four_array_32bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // //建议取消 - // var right_top_text_name = new LeaferUI.Text({ - // x:io_row_right_x_name_32bit, - // y:y,//+10 - // //height:10, - // width:io_row_right_width_name_32bit, - // fill: fill_top_name, - // text:right_top_text_name_four_array_32bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // var right_top_text_name_value = new LeaferUI.Text({ - // x:io_row_right_x_name_32bit, - // y:y,//+10 - // //height:10, - // width:io_row_right_width_value_32bit, - // fill: fill_top_name_value, - // text:right_top_text_value_four_array_32bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // box_32bit.add(left_top_text_name) - // //box_32bit.add(right_top_text_name) - // box_32bit.add(left_top_text_name_value) - // box_32bit.add(right_top_text_name_value) - } - - - //box4效果 - for (var sid = 0; sid < 16; sid++) { - let y = 0; - if (sid < 8) { - y = io_row_height_32bit * (sid) + rect_top_y_offset_32bit; - } - if (sid >= 8) { - y = io_row_height_32bit * (sid + 1) + rect_bottom_y_offset_32bit; - } - var rect_left = new LeaferUI.Rect({ - x: io_rect_left_x_32bit, - y: y + io_rect_left_y_offset_32bit, - height: rect_height_32bit, - width: io_rect_left_width_32bit, - fill: fill_rect, - draggable: false, - id: name_32bit[sid] - }) - var rect_left_text_name = new LeaferUI.Text({ - x: io_rect_name_left_x_32bit, - y: y + io_rect_name_left_y_offset_32bit, - width: io_rect_name_left_width_32bit, - fill: fill_rect_text_name, - text: name_32bit[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_left_text_description = new LeaferUI.Text({ - x: io_rect_description_left_x_32bit, - y: y + io_rect_description_left_y_offset_32bit, - width: io_rect_description_left_width_32bit, - fill: fill_rect_text_description, - text: descriptions_32bit[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - //1罐仓流化阀原输出 - var rect_right = new LeaferUI.Rect({ - x: io_rect_right_x_32bit, - y: y + io_rect_right_y_offset_32bit, - height: rect_height_32bit, - width: io_rect_right_width_32bit, - fill: fill_rect, - draggable: false, - id: name_32bit[sid + 16] - }) - var rect_right_text_name = new LeaferUI.Text({ - x: io_rect_name_right_x_32bit, - y: y + io_rect_name_right_y_offset_32bit, - width: io_rect_name_right_width_32bit, - fill: fill_rect_text_name, - text: name_32bit[sid + 16], - textAlign: 'right', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_right_text_description = new LeaferUI.Text({ - x: io_rect_description_right_x_32bit, - y: y + io_rect_description_right_y_offset_32bit, - width: io_rect_description_right_width_32bit, - fill: fill_rect_text_description, - text: descriptions_32bit[sid + 16], - textAlign: 'right', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - //console.log(rect) - box_32bit.add(rect_left); - box_32bit.add(rect_left_text_name); - box_32bit.add(rect_left_text_description); - box_32bit.add(rect_right); - box_32bit.add(rect_right_text_name); - box_32bit.add(rect_right_text_description); - } - - return box_32bit; - } - - function Draw16bitIOBox(name_16bit, top_text_value_array_16bit, descriptions_16bit, ioboxwidth, initx) { - //16IO生成 - var box_16bit = new LeaferUI.Box({ - x: initx, - y: 20, - width: ioboxwidth, - height: height_iobox, - fill: fill_iobox, - draggable: draggable_dev, - strokeWidth: 1, - stroke: stroke_iobox, - }) - - var ylinex_sum_four = 0; - var ylinex_array_four = []; - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 1) { - ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 2) { - ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 11) { - ylinex_sum_four = ylinex_sum_four + separator_16bit; - ylinex_array_four.push(ylinex_sum_four); - } - else { - ylinex_sum_four = ylinex_sum_four + io_row_height_16bit; - ylinex_array_four.push(ylinex_sum_four); - } - } - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_16bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_16bit.add(line); - } - else if (linexid == 1) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_16bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_16bit.add(line); - } - else if (linexid == 2) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_16bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_16bit.add(line); - } - else if (linexid == 11) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 20, - width: width_iobox_16bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_16bit.add(line); - } - else { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 45, - width: width_iobox_16bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_16bit.add(line); - } - } - - var spiltline_four = new LeaferUI.Line({ - x: width_iobox_16bit / 2, - width: top_row_height_16bit * 2, - rotation: 90, - stroke: stroke_iobox_spiltline, - strokeWidth: 1, - dashPattern: [5, 2] - }) - // box_16bit.add(spiltline_four); - - - //box4左侧顶部状态效果 - for (var tid = 0; tid < 3; tid++) { - let y = io_row_y_offset_16bit + tid * top_row_height_16bit; - if (tid < 2) { - - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_16bit, - y: y,//+10 - //height:10, - width: io_row_left_width_name_16bit, - fill: fill_top_name, - text: top_text_value_array_16bit[tid], + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_32bit, + y: y + io_rect_description_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_description, + text: descriptions_32bit[sid], textAlign: 'left', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - box_16bit.add(top_text_value) + //1罐仓流化阀原输出 + var rect_right = new LeaferUI.Rect({ + x: io_rect_right_x_32bit, + y: y + io_rect_right_y_offset_32bit, + height: rect_height_32bit, + width: io_rect_right_width_32bit, + fill: fill_rect, + draggable: false, + id: name_32bit[sid + 16] + }) + var rect_right_text_name = new LeaferUI.Text({ + x: io_rect_name_right_x_32bit, + y: y + io_rect_name_right_y_offset_32bit, + width: io_rect_name_right_width_32bit, + fill: fill_rect_text_name, + text: name_32bit[sid + 16], + textAlign: 'right', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_right_text_description = new LeaferUI.Text({ + x: io_rect_description_right_x_32bit, + y: y + io_rect_description_right_y_offset_32bit, + width: io_rect_description_right_width_32bit, + fill: fill_rect_text_description, + text: descriptions_32bit[sid + 16], + textAlign: 'right', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + //console.log(rect) + box_32bit.add(rect_left); + box_32bit.add(rect_left_text_name); + box_32bit.add(rect_left_text_description); + box_32bit.add(rect_right); + box_32bit.add(rect_right_text_name); + box_32bit.add(rect_right_text_description); } - if (tid == 2) { - var rect = new LeaferUI.Rect({ - x: io_row_left_x_name_16bit, - y: y - 5, + + return box_32bit; + } + + function Draw16bitIOBox(name_16bit, tagname_16bit, top_text_value_array_16bit, descriptions_16bit, ioboxwidth, initx) { + //16IO生成 + var box_16bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_16bit / 2, + width: top_row_height_16bit * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + // box_16bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_16bit + tid * top_row_height_16bit; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_16bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_16bit, + fill: fill_top_name, + text: top_text_value_array_16bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_16bit.add(top_text_value) + } + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_16bit, + y: y - 5, + height: rect_height_16bit, + width: io_rect_left_width_16bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_16bit[1].replace(' ', '') + '_OnlineSatate' + }) + box_16bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_16bit + io_rect_left_width_16bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_16bit, + fill: fill_top_name, + text: top_text_value_array_16bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_16bit.add(top_text_value) + } + + + // var left_top_text_name_value = new LeaferUI.Text({ + // x:io_row_left_x_value_16bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_value_16bit, + // fill: fill_top_name_value, + // text:left_top_text_value_four_array_16bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // //建议取消 + // var right_top_text_name = new LeaferUI.Text({ + // x:io_row_right_x_name_16bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_name_16bit, + // fill: fill_top_name, + // text:right_top_text_name_four_array_16bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var right_top_text_name_value = new LeaferUI.Text({ + // x:io_row_right_x_name_16bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_value_16bit, + // fill: fill_top_name_value, + // text:right_top_text_value_four_array_16bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // box_16bit.add(left_top_text_name) + // //box_16bit.add(right_top_text_name) + // box_16bit.add(left_top_text_name_value) + // box_16bit.add(right_top_text_name_value) + } + + + //box4效果 + for (var sid = 0; sid < 16; sid++) { + let y = 0; + if (sid < 8) { + y = io_row_height_16bit * (sid) + rect_top_y_offset_16bit; + } + if (sid >= 8) { + y = io_row_height_16bit * (sid + 1) + rect_bottom_y_offset_16bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_16bit, + y: y + io_rect_left_y_offset_16bit, height: rect_height_16bit, width: io_rect_left_width_16bit, fill: fill_rect, draggable: false, - id: top_text_value_array_16bit[1].replace(' ', '') + '_OnlineSatate' + id: tagname_16bit[sid] }) - box_16bit.add(rect) - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_16bit + io_rect_left_width_16bit + 15, - y: y,//+10 - //height:10, - width: io_row_left_width_name_16bit, - fill: fill_top_name, - text: top_text_value_array_16bit[tid], + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_16bit, + y: y + io_rect_name_left_y_offset_16bit, + width: io_rect_name_left_width_16bit, + fill: fill_rect_text_name, + text: name_16bit[sid], textAlign: 'left', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - box_16bit.add(top_text_value) - } - - - // var left_top_text_name_value = new LeaferUI.Text({ - // x:io_row_left_x_value_16bit, - // y:y,//+10 - // //height:10, - // width:io_row_left_width_value_16bit, - // fill: fill_top_name_value, - // text:left_top_text_value_four_array_16bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // //建议取消 - // var right_top_text_name = new LeaferUI.Text({ - // x:io_row_right_x_name_16bit, - // y:y,//+10 - // //height:10, - // width:io_row_right_width_name_16bit, - // fill: fill_top_name, - // text:right_top_text_name_four_array_16bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // var right_top_text_name_value = new LeaferUI.Text({ - // x:io_row_right_x_name_16bit, - // y:y,//+10 - // //height:10, - // width:io_row_right_width_value_16bit, - // fill: fill_top_name_value, - // text:right_top_text_value_four_array_16bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // box_16bit.add(left_top_text_name) - // //box_16bit.add(right_top_text_name) - // box_16bit.add(left_top_text_name_value) - // box_16bit.add(right_top_text_name_value) - } - - - //box4效果 - for (var sid = 0; sid < 16; sid++) { - let y = 0; - if (sid < 8) { - y = io_row_height_16bit * (sid) + rect_top_y_offset_16bit; - } - if (sid >= 8) { - y = io_row_height_16bit * (sid + 1) + rect_bottom_y_offset_16bit; - } - var rect_left = new LeaferUI.Rect({ - x: io_rect_left_x_16bit, - y: y + io_rect_left_y_offset_16bit, - height: rect_height_16bit, - width: io_rect_left_width_16bit, - fill: fill_rect, - draggable: false, - id: name_16bit[sid] - }) - var rect_left_text_name = new LeaferUI.Text({ - x: io_rect_name_left_x_16bit, - y: y + io_rect_name_left_y_offset_16bit, - width: io_rect_name_left_width_16bit, - fill: fill_rect_text_name, - text: name_16bit[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_left_text_description = new LeaferUI.Text({ - x: io_rect_description_left_x_16bit, - y: y + io_rect_description_left_y_offset_16bit, - width: io_rect_description_left_width_16bit, - fill: fill_rect_text_description, - text: descriptions_16bit[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - textOverflow: ' ', - padding: 0, - fontSize: 12 - }) - - box_16bit.add(rect_left); - box_16bit.add(rect_left_text_name); - box_16bit.add(rect_left_text_description); - } - return box_16bit; - } - - function Draw8bitIOBox(name_8bit, top_text_value_array_8bit, descriptions_8bit, ioboxwidth, initx) { - //8IO生成 - var box_8bit = new LeaferUI.Box({ - x: initx, - y: 20, - width: ioboxwidth, - height: height_iobox, - fill: fill_iobox, - draggable: draggable_dev, - strokeWidth: 1, - stroke: stroke_iobox, - }) - - var ylinex_sum_four = 0; - var ylinex_array_four = []; - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 1) { - ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 2) { - ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 11) { - ylinex_sum_four = ylinex_sum_four + separator_8bit; - ylinex_array_four.push(ylinex_sum_four); - } - else { - ylinex_sum_four = ylinex_sum_four + io_row_height_8bit; - ylinex_array_four.push(ylinex_sum_four); - } - } - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_8bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_8bit.add(line); - } - else if (linexid == 1) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_8bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_8bit.add(line); - } - else if (linexid == 2) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_8bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_8bit.add(line); - } - else if (linexid == 11) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 20, - width: width_iobox_8bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_8bit.add(line); - } - else { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 45, - width: width_iobox_8bit, - strokeWidth: 1, - stroke: stroke_iobox_line, - //id: "line" + linexid.toString() - }); - box_8bit.add(line); - } - } - - var spiltline_four = new LeaferUI.Line({ - x: width_iobox_8bit / 2, - width: top_row_height_8bit * 2, - rotation: 90, - stroke: stroke_iobox_spiltline, - strokeWidth: 1, - dashPattern: [5, 2] - }) - // box_8bit.add(spiltline_four); - - - //box4左侧顶部状态效果 - for (var tid = 0; tid < 3; tid++) { - let y = io_row_y_offset_8bit + tid * top_row_height_8bit; - if (tid < 2) { - - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_8bit, - y: y,//+10 - //height:10, - width: io_row_left_width_name_8bit, - fill: fill_top_name, - text: top_text_value_array_8bit[tid], + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_16bit, + y: y + io_rect_description_left_y_offset_16bit, + width: io_rect_description_left_width_16bit, + fill: fill_rect_text_description, + text: descriptions_16bit[sid], textAlign: 'left', verticalAlign: 'middle', textWrap: 'none', + textOverflow: ' ', padding: 0, fontSize: 12 }) - box_8bit.add(top_text_value); + + box_16bit.add(rect_left); + box_16bit.add(rect_left_text_name); + box_16bit.add(rect_left_text_description); } - if (tid == 2) { - var rect = new LeaferUI.Rect({ - x: io_row_left_x_name_8bit, - y: y - 5, + return box_16bit; + } + + function Draw8bitIOBox(name_8bit, tagname_8bit, top_text_value_array_8bit, descriptions_8bit, ioboxwidth, initx) { + //8IO生成 + var box_8bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_8bit / 2, + width: top_row_height_8bit * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + // box_8bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_8bit + tid * top_row_height_8bit; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value); + } + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_8bit, + y: y - 5, + height: rect_height_8bit, + width: io_rect_left_width_8bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_8bit[1].replace(' ', '') + '_OnlineSatate' + }) + box_8bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit + io_rect_left_width_8bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value) + } + + // var left_top_text_name_value = new LeaferUI.Text({ + // x:io_row_left_x_value_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_value_8bit, + // fill: fill_top_name_value, + // text:left_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // //建议取消 + // var right_top_text_name = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_name_8bit, + // fill: fill_top_name, + // text:right_top_text_name_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var right_top_text_name_value = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_value_8bit, + // fill: fill_top_name_value, + // text:right_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // box_8bit.add(left_top_text_name) + // //box_8bit.add(right_top_text_name) + // box_8bit.add(left_top_text_name_value) + // box_8bit.add(right_top_text_name_value) + } + + + //box4效果 + for (var sid = 0; sid < 8; sid++) { + let y = 0; + if (sid < 8) { + y = io_row_height_8bit * (sid) + rect_top_y_offset_8bit; + } + if (sid >= 8) { + y = io_row_height_8bit * (sid + 1) + rect_bottom_y_offset_8bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_8bit, + y: y + io_rect_left_y_offset_8bit, height: rect_height_8bit, width: io_rect_left_width_8bit, fill: fill_rect, draggable: false, - id: top_text_value_array_8bit[1].replace(' ', '') + '_OnlineSatate' + id: tagname_8bit[sid] }) - box_8bit.add(rect) - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_8bit + io_rect_left_width_8bit + 15, - y: y,//+10 - //height:10, - width: io_row_left_width_name_8bit, - fill: fill_top_name, - text: top_text_value_array_8bit[tid], + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_8bit, + y: y + io_rect_name_left_y_offset_8bit, + width: io_rect_name_left_width_8bit, + fill: fill_rect_text_name, + text: name_8bit[sid], textAlign: 'left', verticalAlign: 'middle', textWrap: 'none', padding: 0, fontSize: 12 }) - box_8bit.add(top_text_value) - } + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_8bit, + y: y + io_rect_description_left_y_offset_8bit, + width: io_rect_description_left_width_8bit / 3, + fill: fill_rect_text_description, + text: descriptions_8bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + textOverflow: ' ', + padding: 0, + fontSize: 12 + }) - // var left_top_text_name_value = new LeaferUI.Text({ - // x:io_row_left_x_value_8bit, - // y:y,//+10 - // //height:10, - // width:io_row_left_width_value_8bit, - // fill: fill_top_name_value, - // text:left_top_text_value_four_array_8bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // //建议取消 - // var right_top_text_name = new LeaferUI.Text({ - // x:io_row_right_x_name_8bit, - // y:y,//+10 - // //height:10, - // width:io_row_right_width_name_8bit, - // fill: fill_top_name, - // text:right_top_text_name_four_array_8bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // var right_top_text_name_value = new LeaferUI.Text({ - // x:io_row_right_x_name_8bit, - // y:y,//+10 - // //height:10, - // width:io_row_right_width_value_8bit, - // fill: fill_top_name_value, - // text:right_top_text_value_four_array_8bit[tid], - // textAlign :'left', - // verticalAlign:'middle', - // textWrap:'none', - // padding:0, - // fontSize:12 - // }) - // box_8bit.add(left_top_text_name) - // //box_8bit.add(right_top_text_name) - // box_8bit.add(left_top_text_name_value) - // box_8bit.add(right_top_text_name_value) + box_8bit.add(rect_left); + box_8bit.add(rect_left_text_name); + box_8bit.add(rect_left_text_description); + } + return box_8bit; } - - //box4效果 - for (var sid = 0; sid < 8; sid++) { - let y = 0; - if (sid < 8) { - y = io_row_height_8bit * (sid) + rect_top_y_offset_8bit; - } - if (sid >= 8) { - y = io_row_height_8bit * (sid + 1) + rect_bottom_y_offset_8bit; - } - var rect_left = new LeaferUI.Rect({ - x: io_rect_left_x_8bit, - y: y + io_rect_left_y_offset_8bit, - height: rect_height_8bit, - width: io_rect_left_width_8bit, - fill: fill_rect, - draggable: false, - id: name_8bit[sid] - }) - var rect_left_text_name = new LeaferUI.Text({ - x: io_rect_name_left_x_8bit, - y: y + io_rect_name_left_y_offset_8bit, - width: io_rect_name_left_width_8bit, - fill: fill_rect_text_name, - text: name_8bit[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_left_text_description = new LeaferUI.Text({ - x: io_rect_description_left_x_8bit, - y: y + io_rect_description_left_y_offset_8bit, - width: io_rect_description_left_width_8bit / 3, - fill: fill_rect_text_description, - text: descriptions_8bit[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - textOverflow: ' ', - padding: 0, - fontSize: 12 + function Draw32bitAnalogIOBox(name_32bit, tagname_32bit, top_text_value_array_32bit, descriptions_32bit, ioboxwidth, initx) { + var box_32bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, }) - box_8bit.add(rect_left); - box_8bit.add(rect_left_text_name); - box_8bit.add(rect_left_text_description); + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_32bit; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_32bit.add(line); + } + //box_32bit.add(line); + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox / 2, + y: top_row_height_32bit * 3, + width: height_iobox - top_row_height_32bit * 3, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + box_32bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_32bit + tid * top_row_height_32bit; + if (tid < 2) { + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_32bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_32bit, + fill: fill_top_name, + text: top_text_value_array_32bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_32bit.add(top_text_value) + } + + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_32bit, + y: y - 5, + height: rect_height_32bit, + width: io_rect_left_width_32bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_32bit[1].replace(' ', '') + '_OnlineSatate' + }) + //debugger; + box_32bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_32bit + io_rect_left_width_32bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_32bit, + fill: fill_top_name, + text: top_text_value_array_32bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_32bit.add(top_text_value) + } + + } + + + //box4效果 + for (var sid = 0; sid < 16; sid++) { + let y = 0; + if (sid < 8) { + y = io_row_height_32bit * (sid) + rect_top_y_offset_32bit; + } + if (sid >= 8) { + y = io_row_height_32bit * (sid + 1) + rect_bottom_y_offset_32bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_32bit, + y: y + io_rect_left_y_offset_32bit, + height: rect_height_32bit, + width: io_rect_left_width_32bit, + fill: fill_rect_io_on, + draggable: false, + id: tagname_32bit[sid] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_name_left_width_32bit, + fill: fill_rect_text_name, + text: name_32bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_Avalue = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit + io_rect_name_left_width_32bit, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_name, + text: 111111, + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12, + id: tagname_32bit[sid] + '_value' + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_32bit, + y: y + io_rect_description_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_description, + text: descriptions_32bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + //1罐仓流化阀原输出 + var rect_right = new LeaferUI.Rect({ + x: io_rect_right_x_32bit, + y: y + io_rect_right_y_offset_32bit, + height: rect_height_32bit, + width: io_rect_right_width_32bit, + fill: fill_rect_io_on, + draggable: false, + id: name_32bit[sid + 16] + }) + var rect_right_text_name = new LeaferUI.Text({ + x: io_rect_name_right_x_32bit, + y: y + io_rect_name_right_y_offset_32bit, + width: io_rect_name_right_width_32bit, + fill: fill_rect_text_name, + text: name_32bit[sid + 16], + textAlign: 'right', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_right_text_description = new LeaferUI.Text({ + x: io_rect_description_right_x_32bit, + y: y + io_rect_description_right_y_offset_32bit, + width: io_rect_description_right_width_32bit, + fill: fill_rect_text_description, + text: descriptions_32bit[sid + 16], + textAlign: 'right', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + //console.log(rect) + box_32bit.add(rect_left); + box_32bit.add(rect_left_text_name); + box_32bit.add(rect_left_text_Avalue); + box_32bit.add(rect_left_text_description); + box_32bit.add(rect_right); + box_32bit.add(rect_right_text_name); + box_32bit.add(rect_right_text_description); + } + + return box_32bit; } - return box_8bit; - } - function DrawCPUBox(name_cpu, top_text_value_array_cpu, descriptions_cpu, name_eth_cpu, descriptions_eth_cpu, ioboxwidth, initx) { - var box_cpu = new LeaferUI.Box({ - x: initx, - y: 20, - width: ioboxwidth, - height: height_iobox, - fill: fill_iobox, - draggable: draggable_dev, - strokeWidth: 1, - stroke: stroke_iobox, - }) - var box_return = new LeaferUI.Box({ - x: 0, - y: -22, - width: 122, - height: 20, - //fill: fill_iobox, - draggable: draggable_dev, - strokeWidth: 1, - stroke: stroke_iobox, - }) - const image_return_menu = new LeaferUI.Image({ - x: 0, - y: 0, - url: '/imagesnet/返回.png', - draggable: draggable_dev, - width: 20, - height: 20, - }) - var text_return_menu = new LeaferUI.Text({ - x: 25, - y: 22, - width: 60, - fill: fill_top_name, - text: '返回网络状态', - textAlign: 'left', - verticalAlign: 'bottom', - textWrap: 'none', - padding: 0, - fontSize: 16 - }) - box_return.add(image_return_menu) - box_return.add(text_return_menu) - box_cpu.add(box_return) - box_cpu.on(LeaferUI.PointerEvent.TAP, function () { - leafer.add(group) - leafer.remove(groupio) + function Draw16bitAnalogIOBox(name_16bit, tagname_16bit, top_text_value_array_16bit, descriptions_16bit, ioboxwidth, initx) { + //16IO生成 + var box_16bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_16bit; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_16bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_16bit.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_16bit / 2, + width: top_row_height_16bit * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + // box_16bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_16bit + tid * top_row_height_16bit; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_16bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_16bit, + fill: fill_top_name, + text: top_text_value_array_16bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_16bit.add(top_text_value) + } + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_16bit, + y: y - 5, + height: rect_height_16bit, + width: io_rect_left_width_16bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_16bit[1].replace(' ', '') + '_OnlineSatate' + }) + box_16bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_16bit + io_rect_left_width_16bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_16bit, + fill: fill_top_name, + text: top_text_value_array_16bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_16bit.add(top_text_value) + } + + + // var left_top_text_name_value = new LeaferUI.Text({ + // x:io_row_left_x_value_16bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_value_16bit, + // fill: fill_top_name_value, + // text:left_top_text_value_four_array_16bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // //建议取消 + // var right_top_text_name = new LeaferUI.Text({ + // x:io_row_right_x_name_16bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_name_16bit, + // fill: fill_top_name, + // text:right_top_text_name_four_array_16bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var right_top_text_name_value = new LeaferUI.Text({ + // x:io_row_right_x_name_16bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_value_16bit, + // fill: fill_top_name_value, + // text:right_top_text_value_four_array_16bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // box_16bit.add(left_top_text_name) + // //box_16bit.add(right_top_text_name) + // box_16bit.add(left_top_text_name_value) + // box_16bit.add(right_top_text_name_value) + } + + + //box4效果 + for (var sid = 0; sid < 16; sid++) { + let y = 0; + if (sid < 8) { + y = io_row_height_32bit * (sid) + rect_top_y_offset_32bit; + } + if (sid >= 8) { + y = io_row_height_32bit * (sid + 1) + rect_bottom_y_offset_32bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_32bit, + y: y + io_rect_left_y_offset_32bit, + height: rect_height_32bit, + width: io_rect_left_width_32bit, + fill: fill_rect_io_on, + draggable: false, + id: tagname_16bit[sid] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_name_left_width_32bit, + fill: fill_rect_text_name, + text: name_16bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_Avalue = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit + io_rect_name_left_width_32bit + 15, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_name, + text: 32767, + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12, + id: tagname_16bit[sid] + '_value' + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_32bit, + y: y + io_rect_description_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_description, + text: descriptions_16bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + // textOverflow: ' ', + padding: 0, + fontSize: 12 + }) + + box_16bit.add(rect_left); + box_16bit.add(rect_left_text_name); + box_16bit.add(rect_left_text_Avalue); + box_16bit.add(rect_left_text_description); + } + return box_16bit; + } + + function Draw8bitAnalogIOBox(name_8bit, tagname_8bit, top_text_value_array_8bit, descriptions_8bit, ioboxwidth, initx) { + //8IO生成 + var box_8bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_8bit / 2, + width: top_row_height_8bit * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + // box_8bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_8bit + tid * top_row_height_8bit; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value); + } + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_8bit, + y: y - 5, + height: rect_height_8bit, + width: io_rect_left_width_8bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_8bit[1].replace(' ', '') + '_OnlineSatate' + }) + box_8bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit + io_rect_left_width_8bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value) + } + + // var left_top_text_name_value = new LeaferUI.Text({ + // x:io_row_left_x_value_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_value_8bit, + // fill: fill_top_name_value, + // text:left_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // //建议取消 + // var right_top_text_name = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_name_8bit, + // fill: fill_top_name, + // text:right_top_text_name_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var right_top_text_name_value = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_value_8bit, + // fill: fill_top_name_value, + // text:right_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // box_8bit.add(left_top_text_name) + // //box_8bit.add(right_top_text_name) + // box_8bit.add(left_top_text_name_value) + // box_8bit.add(right_top_text_name_value) + } + + + //box4效果 + for (var sid = 0; sid < 8; sid++) { + let y = 0; + if (sid < 8) { + y = io_row_height_32bit * (sid) + rect_top_y_offset_32bit; + } + if (sid >= 8) { + y = io_row_height_32bit * (sid + 1) + rect_bottom_y_offset_32bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_32bit, + y: y + io_rect_left_y_offset_32bit, + height: rect_height_32bit, + width: io_rect_left_width_32bit, + fill: fill_rect_io_on, + draggable: false, + id: tagname_8bit[sid] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_name_left_width_32bit, + fill: fill_rect_text_name, + text: name_8bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_Avalue = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit + io_rect_name_left_width_32bit + 15, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_name, + text: 32767, + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12, + id: tagname_8bit[sid] + '_value' + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_32bit, + y: y + io_rect_description_left_y_offset_32bit, + width: io_rect_description_left_width_32bit / 3, + fill: fill_rect_text_description, + text: descriptions_8bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + + box_8bit.add(rect_left); + box_8bit.add(rect_left_text_name); + box_8bit.add(rect_left_text_Avalue); + box_8bit.add(rect_left_text_description); + } + return box_8bit; + } + + function Draw4bitAnalogIOBox(name_8bit, tagname_8bit, top_text_value_array_8bit, descriptions_8bit, ioboxwidth, initx) { + //8IO生成 + var box_8bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_8bit / 2, + width: top_row_height_8bit * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + // box_8bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_8bit + tid * top_row_height_8bit; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value); + } + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_8bit, + y: y - 5, + height: rect_height_8bit, + width: io_rect_left_width_8bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_8bit[1].replace(' ', '') + '_OnlineSatate' + }) + box_8bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit + io_rect_left_width_8bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value) + } + + // var left_top_text_name_value = new LeaferUI.Text({ + // x:io_row_left_x_value_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_value_8bit, + // fill: fill_top_name_value, + // text:left_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // //建议取消 + // var right_top_text_name = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_name_8bit, + // fill: fill_top_name, + // text:right_top_text_name_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var right_top_text_name_value = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_value_8bit, + // fill: fill_top_name_value, + // text:right_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // box_8bit.add(left_top_text_name) + // //box_8bit.add(right_top_text_name) + // box_8bit.add(left_top_text_name_value) + // box_8bit.add(right_top_text_name_value) + } + + debugger; + //box4效果 + for (var sid = 0; sid < 4; sid++) { + let y = 0; + if (sid < 4) { + y = io_row_height_32bit * (sid) + rect_top_y_offset_32bit; + } + if (sid >= 4) { + y = io_row_height_32bit * (sid + 1) + rect_bottom_y_offset_32bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_32bit, + y: y + io_rect_left_y_offset_32bit, + height: rect_height_32bit, + width: io_rect_left_width_32bit, + fill: fill_rect_io_on, + draggable: false, + id: tagname_8bit[sid] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_name_left_width_32bit, + fill: fill_rect_text_name, + text: name_8bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_Avalue = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit + io_rect_name_left_width_32bit + 15, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_name, + text: 32767, + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12, + id: tagname_8bit[sid] + '_value' + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_32bit, + y: y + io_rect_description_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_description, + text: descriptions_8bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + + box_8bit.add(rect_left); + box_8bit.add(rect_left_text_name); + box_8bit.add(rect_left_text_Avalue); + box_8bit.add(rect_left_text_description); + } + return box_8bit; + } + + function Draw2bitAnalogIOBox(name_8bit, tagname_8bit, top_text_value_array_8bit, descriptions_8bit, ioboxwidth, initx) { + //8IO生成 + var box_8bit = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_8bit; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_8bit, + strokeWidth: 1, + stroke: stroke_iobox_line, + //id: "line" + linexid.toString() + }); + box_8bit.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_8bit / 2, + width: top_row_height_8bit * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + // box_8bit.add(spiltline_four); + + + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_8bit + tid * top_row_height_8bit; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value); + } + if (tid == 2) { + continue; + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_8bit, + y: y - 5, + height: rect_height_8bit, + width: io_rect_left_width_8bit, + fill: fill_rect, + draggable: false, + id: top_text_value_array_8bit[1].replace(' ', '') + '_OnlineSatate' + }) + box_8bit.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_8bit + io_rect_left_width_8bit + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_8bit, + fill: fill_top_name, + text: top_text_value_array_8bit[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_8bit.add(top_text_value) + } + + // var left_top_text_name_value = new LeaferUI.Text({ + // x:io_row_left_x_value_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_left_width_value_8bit, + // fill: fill_top_name_value, + // text:left_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // //建议取消 + // var right_top_text_name = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_name_8bit, + // fill: fill_top_name, + // text:right_top_text_name_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // var right_top_text_name_value = new LeaferUI.Text({ + // x:io_row_right_x_name_8bit, + // y:y,//+10 + // //height:10, + // width:io_row_right_width_value_8bit, + // fill: fill_top_name_value, + // text:right_top_text_value_four_array_8bit[tid], + // textAlign :'left', + // verticalAlign:'middle', + // textWrap:'none', + // padding:0, + // fontSize:12 + // }) + // box_8bit.add(left_top_text_name) + // //box_8bit.add(right_top_text_name) + // box_8bit.add(left_top_text_name_value) + // box_8bit.add(right_top_text_name_value) + } + + debugger; + //box4效果 + for (var sid = 0; sid < 2; sid++) { + let y = 0; + if (sid < 2) { + y = io_row_height_32bit * (sid) + rect_top_y_offset_32bit; + } + if (sid >= 2) { + y = io_row_height_32bit * (sid + 1) + rect_bottom_y_offset_32bit; + } + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_32bit, + y: y + io_rect_left_y_offset_32bit, + height: rect_height_32bit, + width: io_rect_left_width_32bit, + fill: fill_rect_io_on, + draggable: false, + id: tagname_8bit[sid] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_name_left_width_32bit, + fill: fill_rect_text_name, + text: name_8bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_Avalue = new LeaferUI.Text({ + x: io_rect_name_left_x_32bit + io_rect_name_left_width_32bit + 15, + y: y + io_rect_name_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_name, + text: 32767, + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12, + id: tagname_8bit[sid] + '_value' + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_32bit, + y: y + io_rect_description_left_y_offset_32bit, + width: io_rect_description_left_width_32bit, + fill: fill_rect_text_description, + text: descriptions_8bit[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + + box_8bit.add(rect_left); + box_8bit.add(rect_left_text_name); + box_8bit.add(rect_left_text_Avalue); + box_8bit.add(rect_left_text_description); + } + return box_8bit; + } + + function DrawCPUBox(name_cpu, top_text_value_array_cpu, descriptions_cpu, name_eth_cpu, descriptions_eth_cpu, ioboxwidth, initx) { + var box_cpu = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + var box_return = new LeaferUI.Box({ + x: 0, + y: -22, + width: 122, + height: 20, + //fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + const image_return_menu = new LeaferUI.Image({ + x: 0, + y: 0, + url: '/imagesnet/返回.png', + draggable: draggable_dev, + width: 20, + height: 20, + }) + var text_return_menu = new LeaferUI.Text({ + x: 25, + y: 22, + width: 60, + fill: fill_top_name, + text: '返回网络状态', + textAlign: 'left', + verticalAlign: 'bottom', + textWrap: 'none', + padding: 0, + fontSize: 16 + }) + box_return.add(image_return_menu) + box_return.add(text_return_menu) + box_cpu.add(box_return) + box_cpu.on(LeaferUI.PointerEvent.TAP, function () { + leafer.add(group) + leafer.remove(groupio) + }); + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_cpu; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_cpu; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_cpu; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_cpu; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_cpu; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_cpu, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cpu.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_cpu, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cpu.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_cpu, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cpu.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_cpu, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cpu.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_cpu, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cpu.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_cpu / 2, + width: top_row_height_cpu * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_cpu + tid * top_row_height_cpu; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_cpu, + y: y,//+10 + //height:10, + width: io_row_left_width_name_cpu, + fill: fill_top_name, + text: top_text_value_array_cpu[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_cpu.add(top_text_value); + } + if (tid == 2) { + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_cpu, + y: y - 5, + height: rect_height_cpu, + width: io_rect_left_width_cpu, + fill: fill_rect, + draggable: false, + id: top_text_value_array_cpu[1].replace(' ', '') + '_OnlineSatate' + }) + box_cpu.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_cpu + io_rect_left_width_cpu + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_cpu, + fill: fill_top_name, + text: top_text_value_array_cpu[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_cpu.add(top_text_value) + } + + } + //box4效果 + for (var sid = 0; sid < 16; sid++) { + let y = 0; + + if (sid < 8) { + y = io_row_height_cpu * (sid) + rect_top_y_offset_cpu; + } + if (sid >= 8) { + y = io_row_height_cpu * (sid + 1) + rect_bottom_y_offset_cpu; + } + if (sid < 3) { + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_cpu, + y: y + io_rect_left_y_offset_cpu, + height: rect_height_cpu, + width: io_rect_left_width_cpu, + fill: fill_rect, + draggable: false, + id: name_cpu[sid] + '1' + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_cpu, + y: y + io_rect_name_left_y_offset_cpu, + width: io_rect_name_left_width_cpu, + fill: fill_rect_text_name, + text: name_cpu[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_cpu, + y: y + io_rect_description_left_y_offset_cpu, + width: io_rect_description_left_width_cpu / 3, + fill: fill_rect_text_description, + text: descriptions_cpu[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + textOverflow: ' ', + padding: 0, + fontSize: 12 + }) + + box_cpu.add(rect_left); + box_cpu.add(rect_left_text_name); + box_cpu.add(rect_left_text_description); + } + else if (7 < sid && sid < (8 + name_eth_cpu.length)) { + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_cpu, + y: y + io_rect_left_y_offset_cpu, + height: rect_height_cpu, + width: io_rect_left_width_cpu, + fill: fill_rect, + draggable: false, + id: name_eth_cpu[sid - 8] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_cpu, + y: y + io_rect_name_left_y_offset_cpu, + width: io_rect_name_left_width_cpu, + fill: fill_rect_text_name, + text: name_eth_cpu[sid - 8], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_cpu, + y: y + io_rect_description_left_y_offset_cpu, + width: io_rect_description_left_width_cpu / 3, + fill: fill_rect_text_description, + text: descriptions_eth_cpu[sid - 8], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + textOverflow: ' ', + padding: 0, + fontSize: 12 + }) + + box_cpu.add(rect_left); + box_cpu.add(rect_left_text_name); + box_cpu.add(rect_left_text_description); + } + } + return box_cpu; + } + + function DrawCMBox(name_cm, top_text_value_array_cm, descriptions_cm, name_eth_cm, descriptions_eth_cm, ioboxwidth, initx) { + var box_cm = new LeaferUI.Box({ + x: initx, + y: 20, + width: ioboxwidth, + height: height_iobox, + fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + + var ylinex_sum_four = 0; + var ylinex_array_four = []; + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + ylinex_sum_four = ylinex_sum_four + top_row_height_cm; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 1) { + ylinex_sum_four = ylinex_sum_four + top_row_height_cm; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 2) { + ylinex_sum_four = ylinex_sum_four + top_row_height_cm; + ylinex_array_four.push(ylinex_sum_four); + } + else if (linexid == 11) { + ylinex_sum_four = ylinex_sum_four + separator_cm; + ylinex_array_four.push(ylinex_sum_four); + } + else { + ylinex_sum_four = ylinex_sum_four + io_row_height_cm; + ylinex_array_four.push(ylinex_sum_four); + } + } + for (var linexid = 0; linexid < 19; linexid++) { + if (linexid == 0) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_cm, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cm.add(line); + } + else if (linexid == 1) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_cm, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cm.add(line); + } + else if (linexid == 2) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 35, + width: width_iobox_cm, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cm.add(line); + } + else if (linexid == 11) { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 20, + width: width_iobox_cm, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cm.add(line); + } + else { + var line = new LeaferUI.Line({ + x: 0, + y: ylinex_array_four[linexid],// ylinex_sum_four + 45, + width: width_iobox_cm, + strokeWidth: 1, + stroke: stroke_iobox_line, + }); + box_cm.add(line); + } + } + + var spiltline_four = new LeaferUI.Line({ + x: width_iobox_cm / 2, + width: top_row_height_cm * 2, + rotation: 90, + stroke: stroke_iobox_spiltline, + strokeWidth: 1, + dashPattern: [5, 2] + }) + //box4左侧顶部状态效果 + for (var tid = 0; tid < 3; tid++) { + let y = io_row_y_offset_cm + tid * top_row_height_cm; + if (tid < 2) { + + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_cm, + y: y,//+10 + //height:10, + width: io_row_left_width_name_cm, + fill: fill_top_name, + text: top_text_value_array_cm[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_cm.add(top_text_value); + } + if (tid == 2) { + var rect = new LeaferUI.Rect({ + x: io_row_left_x_name_cm, + y: y - 5, + height: rect_height_cm, + width: io_rect_left_width_cm, + fill: fill_rect, + draggable: false, + id: top_text_value_array_cm[1].replace(' ', '') + '_OnlineSatate' + }) + box_cm.add(rect) + var top_text_value = new LeaferUI.Text({ + x: io_row_left_x_name_cm + io_rect_left_width_cm + 15, + y: y,//+10 + //height:10, + width: io_row_left_width_name_cm, + fill: fill_top_name, + text: top_text_value_array_cm[tid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + box_cm.add(top_text_value) + } + + } + //box4效果 + for (var sid = 0; sid < 16; sid++) { + let y = 0; + + if (sid < 8) { + y = io_row_height_cm * (sid) + rect_top_y_offset_cm; + } + if (sid >= 8) { + y = io_row_height_cm * (sid + 1) + rect_bottom_y_offset_cm; + } + if (sid < 3) { + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_cm, + y: y + io_rect_left_y_offset_cm, + height: rect_height_cm, + width: io_rect_left_width_cm, + fill: fill_rect, + draggable: false, + id: name_cm[sid] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_cm, + y: y + io_rect_name_left_y_offset_cm, + width: io_rect_name_left_width_cm, + fill: fill_rect_text_name, + text: name_cm[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_cm, + y: y + io_rect_description_left_y_offset_cm, + width: io_rect_description_left_width_cm / 3, + fill: fill_rect_text_description, + text: descriptions_cm[sid], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + textOverflow: ' ', + padding: 0, + fontSize: 12 + }) + + box_cm.add(rect_left); + box_cm.add(rect_left_text_name); + box_cm.add(rect_left_text_description); + } + else if (7 < sid && sid < (8 + name_eth_cm.length)) { + var rect_left = new LeaferUI.Rect({ + x: io_rect_left_x_cm, + y: y + io_rect_left_y_offset_cm, + height: rect_height_cm, + width: io_rect_left_width_cm, + fill: fill_rect, + draggable: false, + id: name_eth_cm[sid - 8] + }) + var rect_left_text_name = new LeaferUI.Text({ + x: io_rect_name_left_x_cm, + y: y + io_rect_name_left_y_offset_cm, + width: io_rect_name_left_width_cm, + fill: fill_rect_text_name, + text: name_eth_cm[sid - 8], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + padding: 0, + fontSize: 12 + }) + var rect_left_text_description = new LeaferUI.Text({ + x: io_rect_description_left_x_cm, + y: y + io_rect_description_left_y_offset_cm, + width: io_rect_description_left_width_cm / 3, + fill: fill_rect_text_description, + text: descriptions_eth_cm[sid - 8], + textAlign: 'left', + verticalAlign: 'middle', + textWrap: 'none', + textOverflow: ' ', + padding: 0, + fontSize: 12 + }) + + box_cm.add(rect_left); + box_cm.add(rect_left_text_name); + box_cm.add(rect_left_text_description); + } + } + return box_cm; + } + + function DrawReturnBox(box) { + var box_return = new LeaferUI.Box({ + x: 0, + y: -22, + width: 122, + height: 20, + //fill: fill_iobox, + draggable: draggable_dev, + strokeWidth: 1, + stroke: stroke_iobox, + }) + const image_return_menu = new LeaferUI.Image({ + x: 0, + y: 0, + url: '/imagesnet/返回.png', + draggable: draggable_dev, + width: 20, + height: 20, + }) + var text_return_menu = new LeaferUI.Text({ + x: 25, + y: 22, + width: 60, + fill: fill_top_name, + text: '返回网络状态', + textAlign: 'left', + verticalAlign: 'bottom', + textWrap: 'none', + padding: 0, + fontSize: 16 + }) + box_return.add(image_return_menu) + box_return.add(text_return_menu) + box.add(box_return) + box.on(LeaferUI.PointerEvent.TAP, function () { + leafer.add(group) + leafer.remove(groupio) + }); + } + + groupiolist.push(groupio) + leafer.findOne('#' + devlist[id].DeviceName).on(LeaferUI.PointerEvent.DOUBLE_TAP, function () { + // layer.open({ + // type: 2, // iframe层类型 + // title: 'S7 400 IO状态', + // area: ['95%', '95%'], // 设置弹出层大小 + // content: '/PenMeiReportManage/PenMeiJMReportNew/Index' // 指定要加载的URL地址 + // }); + leafer.remove(group) + leafer.add(groupio) }); - var ylinex_sum_four = 0; - var ylinex_array_four = []; - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - ylinex_sum_four = ylinex_sum_four + top_row_height_cpu; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 1) { - ylinex_sum_four = ylinex_sum_four + top_row_height_cpu; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 2) { - ylinex_sum_four = ylinex_sum_four + top_row_height_cpu; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 11) { - ylinex_sum_four = ylinex_sum_four + separator_cpu; - ylinex_array_four.push(ylinex_sum_four); - } - else { - ylinex_sum_four = ylinex_sum_four + io_row_height_cpu; - ylinex_array_four.push(ylinex_sum_four); - } - } - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_cpu, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cpu.add(line); - } - else if (linexid == 1) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_cpu, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cpu.add(line); - } - else if (linexid == 2) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_cpu, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cpu.add(line); - } - else if (linexid == 11) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 20, - width: width_iobox_cpu, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cpu.add(line); - } - else { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 45, - width: width_iobox_cpu, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cpu.add(line); - } - } - - var spiltline_four = new LeaferUI.Line({ - x: width_iobox_cpu / 2, - width: top_row_height_cpu * 2, - rotation: 90, - stroke: stroke_iobox_spiltline, - strokeWidth: 1, - dashPattern: [5, 2] - }) - //box4左侧顶部状态效果 - for (var tid = 0; tid < 3; tid++) { - let y = io_row_y_offset_cpu + tid * top_row_height_cpu; - if (tid < 2) { - - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_cpu, - y: y,//+10 - //height:10, - width: io_row_left_width_name_cpu, - fill: fill_top_name, - text: top_text_value_array_cpu[tid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - box_cpu.add(top_text_value); - } - if (tid == 2) { - var rect = new LeaferUI.Rect({ - x: io_row_left_x_name_cpu, - y: y - 5, - height: rect_height_cpu, - width: io_rect_left_width_cpu, - fill: fill_rect, - draggable: false, - id: top_text_value_array_cpu[1].replace(' ', '') + '_OnlineSatate' - }) - box_cpu.add(rect) - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_cpu + io_rect_left_width_cpu + 15, - y: y,//+10 - //height:10, - width: io_row_left_width_name_cpu, - fill: fill_top_name, - text: top_text_value_array_cpu[tid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - box_cpu.add(top_text_value) - } - - } - //box4效果 - for (var sid = 0; sid < 16; sid++) { - let y = 0; - - if (sid < 8) { - y = io_row_height_cpu * (sid) + rect_top_y_offset_cpu; - } - if (sid >= 8) { - y = io_row_height_cpu * (sid + 1) + rect_bottom_y_offset_cpu; - } - if (sid < 3) { - var rect_left = new LeaferUI.Rect({ - x: io_rect_left_x_cpu, - y: y + io_rect_left_y_offset_cpu, - height: rect_height_cpu, - width: io_rect_left_width_cpu, - fill: fill_rect, - draggable: false, - id: name_cpu[sid] + '1' - }) - var rect_left_text_name = new LeaferUI.Text({ - x: io_rect_name_left_x_cpu, - y: y + io_rect_name_left_y_offset_cpu, - width: io_rect_name_left_width_cpu, - fill: fill_rect_text_name, - text: name_cpu[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_left_text_description = new LeaferUI.Text({ - x: io_rect_description_left_x_cpu, - y: y + io_rect_description_left_y_offset_cpu, - width: io_rect_description_left_width_cpu / 3, - fill: fill_rect_text_description, - text: descriptions_cpu[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - textOverflow: ' ', - padding: 0, - fontSize: 12 - }) - - box_cpu.add(rect_left); - box_cpu.add(rect_left_text_name); - box_cpu.add(rect_left_text_description); - } - else if (7 < sid && sid < (8 + name_eth_cpu.length)) { - var rect_left = new LeaferUI.Rect({ - x: io_rect_left_x_cpu, - y: y + io_rect_left_y_offset_cpu, - height: rect_height_cpu, - width: io_rect_left_width_cpu, - fill: fill_rect, - draggable: false, - id: name_eth_cpu[sid - 8] - }) - var rect_left_text_name = new LeaferUI.Text({ - x: io_rect_name_left_x_cpu, - y: y + io_rect_name_left_y_offset_cpu, - width: io_rect_name_left_width_cpu, - fill: fill_rect_text_name, - text: name_eth_cpu[sid - 8], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_left_text_description = new LeaferUI.Text({ - x: io_rect_description_left_x_cpu, - y: y + io_rect_description_left_y_offset_cpu, - width: io_rect_description_left_width_cpu / 3, - fill: fill_rect_text_description, - text: descriptions_eth_cpu[sid - 8], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - textOverflow: ' ', - padding: 0, - fontSize: 12 - }) - - box_cpu.add(rect_left); - box_cpu.add(rect_left_text_name); - box_cpu.add(rect_left_text_description); - } - } - return box_cpu; + devtaglist.DIO = diolist; + devtaglist.AIO = aiolist; + tags[devlist[id].DeviceName] = devtaglist; } - - function DrawCMBox(name_cm, top_text_value_array_cm, descriptions_cm, name_eth_cm, descriptions_eth_cm, ioboxwidth, initx) { - var box_cm = new LeaferUI.Box({ - x: initx, - y: 20, - width: ioboxwidth, - height: height_iobox, - fill: fill_iobox, - draggable: draggable_dev, - strokeWidth: 1, - stroke: stroke_iobox, - }) - - var ylinex_sum_four = 0; - var ylinex_array_four = []; - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - ylinex_sum_four = ylinex_sum_four + top_row_height_cm; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 1) { - ylinex_sum_four = ylinex_sum_four + top_row_height_cm; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 2) { - ylinex_sum_four = ylinex_sum_four + top_row_height_cm; - ylinex_array_four.push(ylinex_sum_four); - } - else if (linexid == 11) { - ylinex_sum_four = ylinex_sum_four + separator_cm; - ylinex_array_four.push(ylinex_sum_four); - } - else { - ylinex_sum_four = ylinex_sum_four + io_row_height_cm; - ylinex_array_four.push(ylinex_sum_four); - } - } - for (var linexid = 0; linexid < 19; linexid++) { - if (linexid == 0) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_cm, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cm.add(line); - } - else if (linexid == 1) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_cm, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cm.add(line); - } - else if (linexid == 2) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 35, - width: width_iobox_cm, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cm.add(line); - } - else if (linexid == 11) { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 20, - width: width_iobox_cm, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cm.add(line); - } - else { - var line = new LeaferUI.Line({ - x: 0, - y: ylinex_array_four[linexid],// ylinex_sum_four + 45, - width: width_iobox_cm, - strokeWidth: 1, - stroke: stroke_iobox_line, - }); - box_cm.add(line); - } - } - - var spiltline_four = new LeaferUI.Line({ - x: width_iobox_cm / 2, - width: top_row_height_cm * 2, - rotation: 90, - stroke: stroke_iobox_spiltline, - strokeWidth: 1, - dashPattern: [5, 2] - }) - //box4左侧顶部状态效果 - for (var tid = 0; tid < 3; tid++) { - let y = io_row_y_offset_cm + tid * top_row_height_cm; - if (tid < 2) { - - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_cm, - y: y,//+10 - //height:10, - width: io_row_left_width_name_cm, - fill: fill_top_name, - text: top_text_value_array_cm[tid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - box_cm.add(top_text_value); - } - if (tid == 2) { - var rect = new LeaferUI.Rect({ - x: io_row_left_x_name_cm, - y: y - 5, - height: rect_height_cm, - width: io_rect_left_width_cm, - fill: fill_rect, - draggable: false, - id: top_text_value_array_cm[1].replace(' ', '') + '_OnlineSatate' - }) - box_cm.add(rect) - var top_text_value = new LeaferUI.Text({ - x: io_row_left_x_name_cm + io_rect_left_width_cm + 15, - y: y,//+10 - //height:10, - width: io_row_left_width_name_cm, - fill: fill_top_name, - text: top_text_value_array_cm[tid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - box_cm.add(top_text_value) - } - - } - //box4效果 - for (var sid = 0; sid < 16; sid++) { - let y = 0; - - if (sid < 8) { - y = io_row_height_cm * (sid) + rect_top_y_offset_cm; - } - if (sid >= 8) { - y = io_row_height_cm * (sid + 1) + rect_bottom_y_offset_cm; - } - if (sid < 3) { - var rect_left = new LeaferUI.Rect({ - x: io_rect_left_x_cm, - y: y + io_rect_left_y_offset_cm, - height: rect_height_cm, - width: io_rect_left_width_cm, - fill: fill_rect, - draggable: false, - id: name_cm[sid] - }) - var rect_left_text_name = new LeaferUI.Text({ - x: io_rect_name_left_x_cm, - y: y + io_rect_name_left_y_offset_cm, - width: io_rect_name_left_width_cm, - fill: fill_rect_text_name, - text: name_cm[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_left_text_description = new LeaferUI.Text({ - x: io_rect_description_left_x_cm, - y: y + io_rect_description_left_y_offset_cm, - width: io_rect_description_left_width_cm / 3, - fill: fill_rect_text_description, - text: descriptions_cm[sid], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - textOverflow: ' ', - padding: 0, - fontSize: 12 - }) - - box_cm.add(rect_left); - box_cm.add(rect_left_text_name); - box_cm.add(rect_left_text_description); - } - else if (7 < sid && sid < (8 + name_eth_cm.length)) { - var rect_left = new LeaferUI.Rect({ - x: io_rect_left_x_cm, - y: y + io_rect_left_y_offset_cm, - height: rect_height_cm, - width: io_rect_left_width_cm, - fill: fill_rect, - draggable: false, - id: name_eth_cm[sid - 8] - }) - var rect_left_text_name = new LeaferUI.Text({ - x: io_rect_name_left_x_cm, - y: y + io_rect_name_left_y_offset_cm, - width: io_rect_name_left_width_cm, - fill: fill_rect_text_name, - text: name_eth_cm[sid - 8], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - padding: 0, - fontSize: 12 - }) - var rect_left_text_description = new LeaferUI.Text({ - x: io_rect_description_left_x_cm, - y: y + io_rect_description_left_y_offset_cm, - width: io_rect_description_left_width_cm / 3, - fill: fill_rect_text_description, - text: descriptions_eth_cm[sid - 8], - textAlign: 'left', - verticalAlign: 'middle', - textWrap: 'none', - textOverflow: ' ', - padding: 0, - fontSize: 12 - }) - - box_cm.add(rect_left); - box_cm.add(rect_left_text_name); - box_cm.add(rect_left_text_description); - } - } - return box_cm; - } - - - image_PLC.on(LeaferUI.PointerEvent.DOUBLE_TAP, function () { - // layer.open({ - // type: 2, // iframe层类型 - // title: 'S7 400 IO状态', - // area: ['95%', '95%'], // 设置弹出层大小 - // content: '/PenMeiReportManage/PenMeiJMReportNew/Index' // 指定要加载的URL地址 - // }); - leafer.remove(group) - leafer.add(groupio) - }); + // image_PLC.on(LeaferUI.PointerEvent.DOUBLE_TAP, function () { + // // layer.open({ + // // type: 2, // iframe层类型 + // // title: 'S7 400 IO状态', + // // area: ['95%', '95%'], // 设置弹出层大小 + // // content: '/PenMeiReportManage/PenMeiJMReportNew/Index' // 指定要加载的URL地址 + // // }); + // leafer.remove(group) + // leafer.add(groupiolist[0]) + // }); // var element = layui.element; @@ -2683,42 +4480,42 @@ // element.tabChange('layuiminiTab', '/PenMeiChartsManage/PenMeiHistoryTechCharts/Index') // debugger; - - var t1 = null; - function time1() { - clearTimeout(t1); //清除定时器 - UpdataChart1() - t1 = setTimeout(time, 1 * 1000); //设定定时器,循环运行 - } - async function UpdataChart1() { + // var t1 = null; + // function time1() { + // clearTimeout(t1); //清除定时器 + // UpdataChart1() + // t1 = setTimeout(time, 1 * 1000); //设定定时器,循环运行 - myajax = await $.ajax({ - url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOState", - type: "Get", - dataType: "json", - success: function (redata) { + // } + // async function UpdataChart1() { - } - }); - $.when(myajax).done(function (redata) { - debugger; - leafer.findOne('#' + 'RUN1').fill = fill_rect_io_on; - leafer.findOne('#' + 'RUN').fill = fill_rect_io_on; - leafer.findOne('#' + 'ETH0').fill = fill_rect_io_on; - leafer.findOne('#' + 'ETH1').fill = fill_rect_io_on; - leafer.findOne('#' + 'ETH2').fill = fill_rect_io_on; - for (var ioName in redata) { - leafer.findOne('#' + ioName.replace('_', '.')).fill = (redata[ioName] == '1') ? fill_rect_io_on : fill_rect_io_off; + // myajax = await $.ajax({ + // url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOState", + // type: "Get", + // dataType: "json", + // success: function (redata) { - } - for (var ioslot = 0; ioslot < 8; ioslot++) { - leafer.findOne('#' + 'Slot:' + ioslot + '_OnlineSatate').fill = fill_rect_io_on; - } + // } + // }); + // $.when(myajax).done(function (redata) { + // debugger; + // leafer.findOne('#' + 'RUN1').fill = fill_rect_io_on; + // leafer.findOne('#' + 'RUN').fill = fill_rect_io_on; + // leafer.findOne('#' + 'ETH0').fill = fill_rect_io_on; + // leafer.findOne('#' + 'ETH1').fill = fill_rect_io_on; + // leafer.findOne('#' + 'ETH2').fill = fill_rect_io_on; + // for (var ioName in redata) { + // leafer.findOne('#' + ioName.replace('_', '.')).fill = (redata[ioName] == '1') ? fill_rect_io_on : fill_rect_io_off; - }); - } - t1 = setTimeout(time1, 1 * 1000); //开始运行 + // } + // for (var ioslot = 0; ioslot < 8; ioslot++) { + // leafer.findOne('#' + 'Slot:' + ioslot + '_OnlineSatate').fill = fill_rect_io_on; + // } + + // }); + // } + // t1 = setTimeout(time1, 1 * 1000); //开始运行 var t = null; @@ -2731,82 +4528,175 @@ async function UpdataChart() { myajax = await $.ajax({ - url: "/PenMeiReportManage/PenMeiJMReport/GetRealIOState", + url: "/PenMeiReportManage/PenMeiNetWorkStateNew/GetRealIOState", type: "Get", dataType: "json", success: function (redata) { + var tagkeys = Object.keys(tags); + for (var oi = 0; oi < tagkeys.length; oi++) { + let devName = tagkeys[oi]; + var deviobox = leafer.findOne('#' + devName + '_IOBox'); + if (deviobox != null) { + for (let ioName of tags[devName]['DIO']) { + leafer.findOne('#' + ioName).fill = (redata[ioName] == 'True') ? fill_rect_io_off : fill_rect_io_on; + } + for (let ioName of tags[devName]['AIO']) { + leafer.findOne('#' + ioName + '_value').text = redata[ioName]; + + } + } + + } } }); - $.when(myajax).done(function (redata) { - debugger; - leafer.findOne('#' + 'RUN1').fill = fill_rect_io_on; - leafer.findOne('#' + 'RUN').fill = fill_rect_io_on; - leafer.findOne('#' + 'ETH0').fill = fill_rect_io_on; - leafer.findOne('#' + 'ETH1').fill = fill_rect_io_on; - leafer.findOne('#' + 'ETH2').fill = fill_rect_io_on; - for (var ioName in redata) { - leafer.findOne('#' + ioName.replace('_', '.')).fill = (redata[ioName] == '1') ? fill_rect_io_on : fill_rect_io_off; + // $.when(myajax).done(function (redata) { + // // debugger; + // // leafer.findOne('#' + 'RUN1').fill = fill_rect_io_on; + // // leafer.findOne('#' + 'RUN').fill = fill_rect_io_on; + // // leafer.findOne('#' + 'ETH0').fill = fill_rect_io_on; + // // leafer.findOne('#' + 'ETH1').fill = fill_rect_io_on; + // // leafer.findOne('#' + 'ETH2').fill = fill_rect_io_on; - } - for (var ioslot = 0; ioslot < 8; ioslot++) { - leafer.findOne('#' + 'Slot:' + ioslot + '_OnlineSatate').fill = fill_rect_io_on; - } - }); + // var tagkeys = Object.keys(tags); + // for (var oi = 0; oi < tagkeys.length; oi++) { + // console.log(tagkeys[oi]); + // debugger; + // } + // // for (let ioName of tags) { + // // leafer.findOne('#' + ioName).fill = (redata[ioName] == '1') ? fill_rect_io_off : fill_rect_io_on; + + // // } + // // for (var ioslot = 0; ioslot < 16; ioslot++) { + // // leafer.findOne('#' + 'Slot:' + ioslot + '_OnlineSatate').fill = fill_rect_io_on; + // // } + + // }); } t = setTimeout(time, 1 * 1000); //开始运行 + // var DevNTState = [] + // var tNT = null; + // async function timeNT() { + // clearTimeout(t); //清除定时器 + // UpdataNT() + // t = setTimeout(timeNT, 1 * 10000); //设定定时器,循环运行 + + // } + // async function UpdataNT() { + // devRealajax = $.ajax({ + // url: "/PenMeiReportManage/PenMeiNetWorkStateNew/GetRealDevNetWork", + // type: "Get", + // dataType: "json", + // async: false, + // success: function (redata) { + // DevNTState = redata.Result; + // } + // }) + // } + // tNT = setTimeout(timeNT, 1 * 1000); //开始运行 + + + + var isporcess = false; var lineT = true; var t2 = null; - function time2() { + async function time2() { clearTimeout(t2); //清除定时器 UpShadow() if (lineT) { - t2 = setTimeout(time2, 1 * 100); //设定定时器,循环运行 + t2 = setTimeout(time2, 1 * 3000); //设定定时器,循环运行 } else { - t2 = setTimeout(time2, 1 * 500); //设定定时器,循环运行 + t2 = setTimeout(time2, 1 * 247); //设定定时器,循环运行 } - //t2 = setTimeout(time2, 1 * 200); //设定定时器,循环运行 + // t2 = setTimeout(time2, 1 * 3000); 设定定时器,循环运行 } - function lineTT(linename,linestate) { + async function lineTT(linename,linestate) { leafer.findOne('#' + linename).shadow.blur = linestate?10:10; leafer.findOne('#' + linename).stroke = linestate ? 'rgb(50,205,121)' : '#FF0000' leafer.findOne('#' + linename).shadow.color = linestate ? 'rgb(50,205,121)' : '#FF0000AA' } - function lineTF(linename) { + async function lineTF(linename) { leafer.findOne('#' + linename).shadow.blur = 1; leafer.findOne('#' + linename).stroke = '#cecece' leafer.findOne('#' + linename).shadow.color = '#cecece' } async function UpShadow() { - if (lineT) { - lineTT("line11", b11) - lineTT("line12", b12) - lineTT("line13", b13) - lineTT("line14", b14) - lineTT("line21", b21) - lineTT("line31", b31) - lineTT("line32", b32) - lineTT("line33", b33) - lineTT("line34", b34) - lineTT("line35", b35) - } else { - lineTF("line11") - lineTF("line12") - lineTF("line13") - lineTF("line14") - lineTF("line21") - lineTF("line31") - lineTF("line32") - lineTF("line33") - lineTF("line34") - lineTF("line35") - } - lineT = !lineT; + + devRealajax = await $.ajax({ + url: "/PenMeiReportManage/PenMeiNetWorkStateNew/GetRealDevNetWork", + type: "Get", + dataType: "json", + async: true, + success: function (redata) { + var realdata = redata.Result; + for (var ri = 0; ri < realdata.length; ri++) { + var linename = 'line_' + realdata[ri].DeviceName; + // lineTT(linename, (realdata[ri].DeviceNetWorkStatus == 'True')) + if (lineT) { + lineTT(linename, (realdata[ri].DeviceNetWorkStatus == 'True')) + } + else { + lineTF(linename) + } + } + } + }); + // var realdata = DevNTState; + // for (var ri = 0; ri < realdata.length; ri++) { + // var linename = 'line_' + realdata[ri].DeviceName; + // lineTT(linename, (realdata[ri].DeviceNetWorkStatus == 'True')) + // } + // }) + lineT = !lineT; + // if (lineT) { + // // lineTT("line11", b11) + // // lineTT("line12", b12) + // // lineTT("line13", b13) + // // lineTT("line31", b31) + + // // lineTT("line41", b41) + // // lineTT("line42", b42) + // // lineTT("line43", b43) + // // lineTT("line44", b44) + // // lineTT("line45", b45) + // } else { + // // lineTF("line11") + // // lineTF("line12") + // // lineTF("line13") + // // lineTF("line31") + // // lineTF("line41", b41) + // // lineTF("line42", b42) + // // lineTF("line43", b43) + // // lineTF("line44", b44) + // // lineTF("line45", b45) + // } } + + // 使用Deferred对象进行异步操作 + // asyncOperation().then(function (data) { + // var realdata = data.Result; + // for (var ri = 0; ri < realdata.length; ri++) { + // var linename = 'line_' + realdata[ri].DeviceName; + // lineTT(linename, (realdata[ri].DeviceNetWorkStatus == 'True')) + // // if (lineT) { + // // lineTT(linename, (realdata[ri].DeviceNetWorkStatus == 'True')) + // // } + // // else { + // // lineTF(linename) + // // } + // } // 处理异步操作成功的数据 + // }).fail(function () { + // console.log("异步操作失败"); + // }).always(function () { + // console.log("异步操作完成"); + // }); + t2 = setTimeout(time2, 1 * 300); //开始运行 + + }) diff --git a/HT.Cloud.Web/DataProtection/key-dd8eb8fc-f638-45a4-a044-c3402c318748.xml b/HT.Cloud.Web/DataProtection/key-dd8eb8fc-f638-45a4-a044-c3402c318748.xml new file mode 100644 index 0000000..20973cc --- /dev/null +++ b/HT.Cloud.Web/DataProtection/key-dd8eb8fc-f638-45a4-a044-c3402c318748.xml @@ -0,0 +1,16 @@ + + + 2024-08-13T06:29:44.369466Z + 2024-08-13T06:29:44.1402872Z + 2024-11-11T06:29:44.1402872Z + + + + + + + KsRf49m4rQvK4WjUzfReQqrnpmA5UnP4zmAn7Vp0oH774U+MBUCNOC6B3Wlo/JD+jBH1lU1WSL2HWy36OTygyw== + + + + \ No newline at end of file diff --git a/HT.Cloud.Web/WaterCloud.Web.xml b/HT.Cloud.Web/WaterCloud.Web.xml index 749a2cf..9109fbd 100644 --- a/HT.Cloud.Web/WaterCloud.Web.xml +++ b/HT.Cloud.Web/WaterCloud.Web.xml @@ -11,7 +11,7 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID @@ -23,7 +23,7 @@ 描 述:实时趋势控制器类 - + 绑定数据仓库的数据库ID @@ -35,7 +35,7 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID @@ -47,7 +47,7 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID @@ -59,7 +59,7 @@ 描 述:实时趋势控制器类 - + 绑定数据仓库的数据库ID @@ -71,7 +71,7 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID @@ -160,7 +160,7 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID @@ -172,7 +172,7 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID @@ -184,17 +184,17 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID - + 绑定数据仓库的数据库ID - + 绑定数据仓库的数据库ID @@ -206,22 +206,42 @@ 描 述:历史趋势控制器类 - + 绑定数据仓库的数据库ID - + 绑定数据仓库的数据库ID - + 绑定数据仓库的数据库ID - + + + 绑定数据仓库的数据库ID + + + + + 绑定数据仓库的数据库ID + + + + + 绑定数据仓库的数据库ID + + + + + 绑定数据仓库的数据库ID + + + 绑定数据仓库的数据库ID diff --git a/HT.Cloud.Web/wwwroot.rar b/HT.Cloud.Web/wwwroot.rar new file mode 100644 index 0000000..ecdef5f Binary files /dev/null and b/HT.Cloud.Web/wwwroot.rar differ diff --git a/HT.Cloud.Web/wwwroot/js/lay-module/layuimini/miniTheme.js b/HT.Cloud.Web/wwwroot/js/lay-module/layuimini/miniTheme.js index 9d9fd3a..e8b04fd 100644 --- a/HT.Cloud.Web/wwwroot/js/lay-module/layuimini/miniTheme.js +++ b/HT.Cloud.Web/wwwroot/js/lay-module/layuimini/miniTheme.js @@ -430,9 +430,9 @@ layui.define(["jquery", "layer"], function (exports) { '
      \n' + bgColorHtml + '
    \n' + '\n' + '
    \n' + - ' 开发文档\n' + - ' 开源地址\n' + - ' 演示地址\n' + + //' 开发文档\n' + + //' 开源地址\n' + + //' 演示地址\n' + '
    ' + ''; layer.open({