From f845225ed78755ebb8ba9f7266b64b003ed9ebd1 Mon Sep 17 00:00:00 2001 From: chenzhihao <1798906853@qq.com> Date: Mon, 5 Jan 2026 11:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=9E=E8=B7=AF=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E9=A1=B5=E9=9D=A2=E3=80=81=E8=8A=82=E8=83=BD=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E4=B8=8A=E4=BC=A0=E9=A1=B5=E9=9D=A2=E3=80=81=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=86=85=E9=83=A8=E9=A2=84=E7=95=99=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BLV_Studio/BLV_Studio.vbproj | 2 +- BLV_Studio/EnergySavingAttribute.vb | 28 ++--- BLV_Studio/FrmLogin.vb | 2 +- BLV_Studio/My Project/AssemblyInfo.vb | 4 +- BLV_Studio/SetLoopInformation.Designer.vb | 26 ++++- BLV_Studio/SetLoopInformation.resx | 15 +++ BLV_Studio/SetLoopInformation.vb | 105 +++++++++++++++++- BLV_Studio/Test/GridTest/ReportingScenario.vb | 24 ++++ BLV_Studio/Test/GridTest/ServiceAttribute.vb | 7 +- BLV_Studio/Test/GridTest/TableInteraction.vb | 14 ++- 10 files changed, 198 insertions(+), 29 deletions(-) diff --git a/BLV_Studio/BLV_Studio.vbproj b/BLV_Studio/BLV_Studio.vbproj index 483927a..4f47e84 100644 --- a/BLV_Studio/BLV_Studio.vbproj +++ b/BLV_Studio/BLV_Studio.vbproj @@ -35,7 +35,7 @@ 4.0.0.5 true index.html - 73 + 81 4.4.3.%2a false true diff --git a/BLV_Studio/EnergySavingAttribute.vb b/BLV_Studio/EnergySavingAttribute.vb index a445eba..a035e59 100644 --- a/BLV_Studio/EnergySavingAttribute.vb +++ b/BLV_Studio/EnergySavingAttribute.vb @@ -382,8 +382,8 @@ Public Class EnergySavingAttribute For j As Integer = 4 To RatioInit.Cols - 1 '判断是否为空 Dim str As String = RatioInit.Cell(i, j).Text - If String.IsNullOrEmpty(RatioInit.Cell(i, j).Text) AndAlso j <> RatioInit.Cols - 1 Then - MsgBox($"温控 第{RatioInit.Cell(i, 0).Text}行数据缺失请补全数据再进行上传!") + If String.IsNullOrEmpty(RatioInit.Cell(i, j).Text) AndAlso j <> RatioInit.Cols - 1 AndAlso j <> 4 Then + MsgBox($"温控 第{i}行 {j}列数据缺失请补全数据再进行上传!") Return Nothing End If 'RatioInit.Cell(0, 1).Text = "酒店编号" @@ -412,11 +412,11 @@ Public Class EnergySavingAttribute dic.Add("air_model", RatioInit.Cell(i, j).Text.Trim) Case 9 If Not Double.TryParse(RatioInit.Cell(i, j).Text.Trim, fnumber) Then - MsgBox($"温控第{RatioInit.Cell(i, 0).Text}行,【空调节能温差】 数据异常!") + MsgBox($"温控第{i}行{j}列,【空调节能温差】 数据异常!") Return Nothing Else If fnumber >= 15 Or fnumber < 0 Then - MsgBox($"温控第{RatioInit.Cell(i, 0).Text}行,【功率】 数据异常!数值范围为 1到15") + MsgBox($"温控第{i}行{j}列,【功率】 数据异常!数值范围为 1到15") Return Nothing End If @@ -424,20 +424,20 @@ Public Class EnergySavingAttribute dic.Add("temperature", fnumber) Case 10 If Not Double.TryParse(RatioInit.Cell(i, j).Text.Trim, fnumber) Then - MsgBox($"温控第{RatioInit.Cell(i, 0).Text}行,【房间高度】 数据异常!") + MsgBox($"温控第{i}行{j}列,【房间高度】 数据异常!") Return Nothing End If dic.Add("height", fnumber) Case 11 If Not Double.TryParse(RatioInit.Cell(i, j).Text.Trim, fnumber) Then - MsgBox($"温控第{RatioInit.Cell(i, 0).Text}行,【房间面积】 数据异常!") + MsgBox($"温控第{i}行,【房间面积】 数据异常!") Return Nothing End If dic.Add("area", fnumber) Case 12 If Not Double.TryParse(RatioInit.Cell(i, j).Text.Trim, fnumber) Then - MsgBox($"温控第{RatioInit.Cell(i, 0).Text}行,【热损失系数】 数据异常!") + MsgBox($"温控第{i}行{j}列,【热损失系数】 数据异常!") Return Nothing End If dic.Add("heat_loss", fnumber) @@ -480,8 +480,8 @@ Public Class EnergySavingAttribute For j As Integer = 4 To PowerInit.Cols - 1 '判断是否为空 Dim str As String = PowerInit.Cell(i, j).Text - If String.IsNullOrEmpty(PowerInit.Cell(i, j).Text) AndAlso j <> PowerInit.Cols - 1 Then - MsgBox($"第{i}行{j}数据缺失请补全数据再进行上传!") + If String.IsNullOrEmpty(PowerInit.Cell(i, j).Text) AndAlso j <> PowerInit.Cols - 1 AndAlso j <> 4 Then + MsgBox($"第{i}行{j}列数据缺失请补全数据再进行上传!") Return End If @@ -495,11 +495,11 @@ Public Class EnergySavingAttribute dic.Add("address", PowerInit.Cell(i, j).Text.Trim) Case 6 If Not Double.TryParse(PowerInit.Cell(i, j).Text.Trim, fnumber) Then - MsgBox($"第{PowerInit.Cell(i, 0).Text}行,【功率】 数据异常!") + MsgBox($"第{i}行{j}列,【功率】 数据异常!") Return Else If fnumber >= 10000 Or fnumber < 0 Then - MsgBox($"第{PowerInit.Cell(i, 0).Text}行,【功率】 数据异常!数值范围为 1到10000") + MsgBox($"第{i}行{j}列,【功率】 数据异常!数值范围为 1到10000") Return End If End If @@ -507,11 +507,11 @@ Public Class EnergySavingAttribute dic.Add("power", fnumber) Case 7 If Not Double.TryParse(PowerInit.Cell(i, j).Text.Trim, fnumber) Then - MsgBox($"第{PowerInit.Cell(i, 0).Text}行,【节能比例(%)】 数据异常!") + MsgBox($"第{i}行{j}列,【节能比例(%)】 数据异常!") Return Else If fnumber > 100 Or fnumber < 0 Then - MsgBox($"第{PowerInit.Cell(i, 0).Text}行,【节能比例(%)】 数据异常!数值范围为 1到100") + MsgBox($"第{i}行{j}列,【节能比例(%)】 数据异常!数值范围为 1到100") Return End If End If @@ -531,7 +531,7 @@ Public Class EnergySavingAttribute Dim Tli As List(Of Dictionary(Of String, Object)) = GetRatioInitLi() If IsNothing(Tli) Then 'MsgBox("上传失败") - 'Returneks + Return Else '将tli 添加到li中 li.AddRange(Tli) diff --git a/BLV_Studio/FrmLogin.vb b/BLV_Studio/FrmLogin.vb index cb4b0e3..eebc3a9 100644 --- a/BLV_Studio/FrmLogin.vb +++ b/BLV_Studio/FrmLogin.vb @@ -97,7 +97,7 @@ Public Class BFrmLogin End Sub Private Function GetAccountAuth(user As String, pwd As String, appid As Integer) As LoginReturn - Dim jsonString As String = HttpMothod.PostData("http://47.119.147.104:90/OTApi/Login", $"Uid={user}&Pwd={pwd}&appid={_appid}") + Dim jsonString As String = HttpMothod.PostData("http://auth.blv-oa.com/OTApi/Login", $"Uid={user}&Pwd={pwd}&appid={_appid}") If String.IsNullOrWhiteSpace(jsonString) Then Throw New Exception($"ûȨ쳣ϵԱ") Dim login As LoginReturn = JsonConvert.DeserializeObject(Of LoginReturn)(jsonString) diff --git a/BLV_Studio/My Project/AssemblyInfo.vb b/BLV_Studio/My Project/AssemblyInfo.vb index 45a7327..0bc4c10 100644 --- a/BLV_Studio/My Project/AssemblyInfo.vb +++ b/BLV_Studio/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices '通过使用 "*",如下所示: ' - - + + diff --git a/BLV_Studio/SetLoopInformation.Designer.vb b/BLV_Studio/SetLoopInformation.Designer.vb index 9dfd2e5..2b417bb 100644 --- a/BLV_Studio/SetLoopInformation.Designer.vb +++ b/BLV_Studio/SetLoopInformation.Designer.vb @@ -33,13 +33,15 @@ Partial Class SetLoopInformation Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel() Me.Grid1 = New FlexCell.Grid() Me.Timer1 = New System.Windows.Forms.Timer(Me.components) + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() Me.ToolStrip1.SuspendLayout() Me.SuspendLayout() ' 'ToolStrip1 ' Me.ToolStrip1.AutoSize = False - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton7, Me.ToolStripButton1, Me.ToolStripButton5, Me.ToolStripButton4, Me.ToolStripButton6, Me.ToolStripLabel1}) + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton2, Me.ToolStripSeparator1, Me.ToolStripButton7, Me.ToolStripButton1, Me.ToolStripButton5, Me.ToolStripButton4, Me.ToolStripButton6, Me.ToolStripLabel1}) Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) Me.ToolStrip1.Name = "ToolStrip1" Me.ToolStrip1.Size = New System.Drawing.Size(1169, 56) @@ -94,10 +96,10 @@ Partial Class SetLoopInformation 'ToolStripLabel1 ' Me.ToolStripLabel1.ActiveLinkColor = System.Drawing.Color.Red - Me.ToolStripLabel1.Font = New System.Drawing.Font("Microsoft YaHei UI", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.ToolStripLabel1.Font = New System.Drawing.Font("Microsoft YaHei UI", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) Me.ToolStripLabel1.ForeColor = System.Drawing.Color.Red Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(759, 53) + Me.ToolStripLabel1.Size = New System.Drawing.Size(639, 53) Me.ToolStripLabel1.Text = "云端回路地址和云端回路名称仅供配置对照参考上传以本地回路地址和本地回路名称为准!" ' 'Grid1 @@ -115,6 +117,22 @@ Partial Class SetLoopInformation ' Me.Timer1.Interval = 1000 ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.ToolStripButton2.Font = New System.Drawing.Font("Microsoft YaHei UI", 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.ToolStripButton2.ForeColor = System.Drawing.Color.RoyalBlue + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(41, 53) + Me.ToolStripButton2.Text = "全选" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 56) + ' 'SetLoopInformation ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!) @@ -139,4 +157,6 @@ Partial Class SetLoopInformation Friend WithEvents Grid1 As FlexCell.Grid Friend WithEvents ToolStripLabel1 As ToolStripLabel Friend WithEvents Timer1 As Timer + Friend WithEvents ToolStripButton2 As ToolStripButton + Friend WithEvents ToolStripSeparator1 As ToolStripSeparator End Class diff --git a/BLV_Studio/SetLoopInformation.resx b/BLV_Studio/SetLoopInformation.resx index 61a1c65..0d95bfb 100644 --- a/BLV_Studio/SetLoopInformation.resx +++ b/BLV_Studio/SetLoopInformation.resx @@ -199,4 +199,19 @@ 129, 17 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + \ No newline at end of file diff --git a/BLV_Studio/SetLoopInformation.vb b/BLV_Studio/SetLoopInformation.vb index e9e5f3e..82759c2 100644 --- a/BLV_Studio/SetLoopInformation.vb +++ b/BLV_Studio/SetLoopInformation.vb @@ -79,14 +79,35 @@ Public Class SetLoopInformation G_ReportingScenario = nReportingScenario Dim li As List(Of MDevNodeMessage) = nReportingScenario.getDateDisposeRuning + Dim bdic As Dictionary(Of String, String) = nReportingScenario.getDevloop() + For Each item In li If G_loopNameAddr.ContainsKey(item.ModalAddress) Then Continue For Else - G_loopNameAddr.Add(item.ModalAddress, item.Name) + '判断类型为 24 的 名称只取前2个字符 + If item.Type.Equals("4") Then + '判断名称长度是否大于2 + If item.Name.Length > 2 Then + G_loopNameAddr.Add(item.ModalAddress, item.Name.Substring(0, 2)) + Else + G_loopNameAddr.Add(item.ModalAddress, item.Name) + End If + + Else + G_loopNameAddr.Add(item.ModalAddress, item.Name) + End If + End If Next + For Each item In bdic + If G_loopNameAddr.ContainsKey(item.Key) Then + Continue For + Else + G_loopNameAddr.Add(item.Key, item.Value) + End If + Next ' 在 InitializeComponent() 调用之后添加任何初始化。 @@ -531,7 +552,7 @@ Public Class SetLoopInformation Dim strInputMsg As String = InputBox("请输入回路发布密码", "密码确认") - If strInputMsg <> "Cc2022OK" Then Return + If strInputMsg <> "123456" Then Return ToolStripButton6.Enabled = False Dim mSaveRoomTypeModal As SaveRoomTypeModal Dim mSaveRoomTypeModalList As New List(Of SaveRoomTypeModal) @@ -557,6 +578,7 @@ Public Class SetLoopInformation mSaveRoomTypeModal.TCLDeviceName = Grid1.Cell(i, 18).Text mSaveRoomTypeModal.MultipleGroupID = CInt(Grid1.Cell(i, 19).Text) mSaveRoomTypeModal.MultipleTCLName = Grid1.Cell(i, 20).Text + mSaveRoomTypeModal.color = GetColorFromString(mSaveRoomTypeModal.modalAddress) Dim str As String = Grid1.Cell(i, 1).Text Console.WriteLine(str) @@ -598,7 +620,60 @@ Public Class SetLoopInformation End If End Sub + Public Function GetColorFromString(inputString As String) As String + ' 检查输入字符串是否有效 + If String.IsNullOrEmpty(inputString) OrElse inputString.Length < 3 Then + Throw New ArgumentException("输入字符串必须至少包含3个字符") + End If + '提取前三位字符 + Dim firstThreeDigits As String = inputString.Substring(0, 3) + ' 将提取的字符串转换为数字(去掉前导零) + Dim number As Integer + If Not Integer.TryParse(firstThreeDigits, number) Then + Throw New ArgumentException("前三位字符必须是有效的数字") + End If + '判断是为4 + If number <> 4 Then + Return "#000000" + End If + + ' 提取最后三位字符 + Dim lastThreeDigits As String = inputString.Substring(inputString.Length - 3, 3) + + ' 将提取的字符串转换为数字(去掉前导零) + 'Dim number As Integer + If Not Integer.TryParse(lastThreeDigits, number) Then + Throw New ArgumentException("最后三位字符必须是有效的数字") + End If + + ' 根据图片内容创建数字到颜色的映射 + Dim colorMap As New Dictionary(Of Integer, String) From { + {1, "#FF8C69"}, {2, "#802A2A"}, {3, "#228B22"}, {4, "#FF00FF"}, + {5, "#00FFFF"}, {6, "#0000FF"}, {7, "#FF34B3"}, {8, "#FF0000"}, + {9, "#00FF00"}, {10, "#FF6200"}, {11, "#882657"}, {12, "#CD919E"}, + {13, "#CD2626"}, {14, "#BD2626"}, {15, "#A4D3EE"}, {16, "#9F79EE"}, + {17, "#9B30FF"}, {18, "#9A32CD"}, {19, "#8B4C39"}, {20, "#8B4513"}, + {21, "#8B3A3A"}, {22, "#8B2252"}, {23, "#8B008B"}, {24, "#838B8B"}, + {25, "#f7acbc"}, {26, "#ef5b9c"}, {27, "#f05b72"}, {28, "#f8aba6"}, + {29, "#f69c9f"}, {30, "#f58f98"}, {31, "#ca8687"}, {32, "#f391a9"}, + {33, "#bd6758"}, {34, "#d64f44"}, {35, "#d93a49"}, {36, "#b3424a"}, + {37, "#deab8a"}, {38, "#fedcbd"}, {39, "#f47920"}, {40, "#905a3d"}, + {41, "#8f4b2e"}, {42, "#87481f"}, {43, "#5f3c23"}, {44, "#6b473c"}, + {45, "#faa755"}, {46, "#fab27b"}, {47, "#f58220"}, {48, "#905d1d"}, + {49, "#8a5d19"}, {50, "#8c531b"}, {51, "#826858"}, {52, "#817936"}, + {53, "#87843b"}, {54, "#726930"}, {55, "#454926"}, {56, "#2e3a1f"}, + {57, "#444693"}, {58, "#2a5caa"}, {59, "#003a6c"}, {60, "#426ab3"}, + {61, "#46485f"}, {62, "#181d4b"}, {63, "#6a6da9"}, {64, "#585eaa"} + } + + ' 检查数字是否在有效范围内 + If number >= 1 AndAlso number <= 64 Then + Return colorMap(number) + Else + Throw New ArgumentException($"数字 {number} 不在有效范围内 (1-64)") + End If + End Function '上传回路日志 Public Function UploadOLdloopLog(HotelID As String, RoomTypeID As String, ConfigVersion As String, Note As String, UploadUser As String) As Boolean @@ -645,6 +720,32 @@ Public Class SetLoopInformation Private Sub SetLoopInformation_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed Timer1.Stop() End Sub + + Private Sub ToolStripButton2_Click_1(sender As Object, e As EventArgs) Handles ToolStripButton2.Click + '判断按钮文本是否为“全选” + If ToolStripButton2.Text = "全选" Then + + '将文本设置为取消全选 + ToolStripButton2.Text = "取消全选" + '设置按钮文本颜色为 RoyalRed + ToolStripButton2.ForeColor = Color.Red + '将所有复选框选中 + For i As Integer = 0 To Grid1.Rows - 1 + Grid1.Cell(i, 1).Text = "True" + Next + Else + '将文本设置为全选 + ToolStripButton2.Text = "全选" + '设置按钮文本颜色为 RoyalBlue + ToolStripButton2.ForeColor = Color.RoyalBlue + + + '将所有复选框取消选中 + For i As Integer = 0 To Grid1.Rows - 1 + Grid1.Cell(i, 1).Text = "False" + Next + End If + End Sub End Class Public Class RoomDevice Public Property ID As Integer diff --git a/BLV_Studio/Test/GridTest/ReportingScenario.vb b/BLV_Studio/Test/GridTest/ReportingScenario.vb index 4cce31e..ea077cc 100644 --- a/BLV_Studio/Test/GridTest/ReportingScenario.vb +++ b/BLV_Studio/Test/GridTest/ReportingScenario.vb @@ -59,6 +59,28 @@ Public Class ReportingScenario Public Function getDateDisposeRuning() As List(Of MDevNodeMessage) Return DateDisposeRuning(Tgrd, TDevicemodel) End Function + Public Function getDevloop() As Dictionary(Of String, String) + Dim dic As New Dictionary(Of String, String) + Dim devAddr, NodeLoop As String + Dim strbuf As String() + For Each Dev In TDevicemodel + If String.IsNullOrEmpty(Dev.Value.Desc.DevInterface) OrElse Dev.Value.Desc.DevInterface.Equals("VirtualObject") Then Continue For + For Each DevNode In Dev.Value.Nodes + + If Not String.IsNullOrEmpty(DevNode.DEV_TYPE_DATA) Then + devAddr = GetActionDeviceAddr(Dev.Value, DevNode.Name).ToString + NodeLoop = DevNode.DEV_TYPE_DATA.PadLeft(3, "0") & devAddr.PadLeft(3, "0") & "000" + If dic.ContainsKey(NodeLoop) Then Continue For + strbuf = Dev.Key.Split(vbLf) + dic.Add(NodeLoop, strbuf(2)) + + End If + + Next + + Next + Return Dic + End Function Public Function DateDisposeRuning(_grd As FlexCell.Grid, _Devicemodel As Dictionary(Of String, DeviceModel)) As List(Of MDevNodeMessage) If IsNothing(_grd) Then Return Nothing Dim ACtabRange As CtabRange @@ -72,7 +94,9 @@ Public Class ReportingScenario For Each Dev In _Devicemodel '遍历设备 For Each DevNode In Dev.Value.Nodes '遍历设备下属子节点 + Dim devAddr As String = GetActionDeviceAddr(Dev.Value, DevNode.Name).ToString + If DevNode.Interface.Equals("DO") OrElse DevNode.Interface.Equals("LIGHT") Then '判断是否为输出设备 If DevNode.DEV_TYPE_DATA.Equals("4") Then '服务设备节点特殊处理 diff --git a/BLV_Studio/Test/GridTest/ServiceAttribute.vb b/BLV_Studio/Test/GridTest/ServiceAttribute.vb index 6f8738c..9063c02 100644 --- a/BLV_Studio/Test/GridTest/ServiceAttribute.vb +++ b/BLV_Studio/Test/GridTest/ServiceAttribute.vb @@ -46,8 +46,13 @@ Public Class ServiceAttribute Dic_3 = New List(Of String) '单位 Dic_4 = New List(Of String) - + Dim fustr As String = "服务-" For Each node In G_hostNode.Nodes + fustr = "服务-" & node.LoopAddr + '2025 12 29 CZH 增加 判断服务是否是 是在25 到48 且名称符合 "服务-服务号"的格式 符合则不 添加 + If node.LoopAddr >= 25 AndAlso node.LoopAddr <= 48 AndAlso fustr.Equals(node.Name) Then ' + Continue For + End If Dic_1.Add($"{node.LoopAddr}:{node.Name }") Next diff --git a/BLV_Studio/Test/GridTest/TableInteraction.vb b/BLV_Studio/Test/GridTest/TableInteraction.vb index 9b40bb5..5b3da75 100644 --- a/BLV_Studio/Test/GridTest/TableInteraction.vb +++ b/BLV_Studio/Test/GridTest/TableInteraction.vb @@ -7234,6 +7234,8 @@ ON DUPLICATE KEY UPDATE {updatastr};" Dim Server() As String Dim devdatetype As Integer Dim devname As String() + Dim devnamestr As String = "" + Dim bumberstr As String = "" For i=0 To Dic_Devicemodel.Count-1 dev = Dic_Devicemodel.Values(i) If dev.Desc.DevInterface.Equals("VirtualObject") Then Continue For @@ -7245,9 +7247,9 @@ ON DUPLICATE KEY UPDATE {updatastr};" If _grd.Cell(gr,TableColNumber.KeyName).Text.Contains("红外") OrElse _grd.Cell(gr,TableColNumber.KeyName).Text.Contains("雷达")OrElse _grd.Cell(gr,TableColNumber.KeyName).Text.Contains("门磁") Then Server= _grd.Cell(gr,TableColNumber.ServerAttribute).Text.Trim.Split(",") If IsNothing(Server) OrElse Server.Count=0 OrElse string.IsNullOrEmpty(Server(0)) Then Continue For - + bumberstr=$"{_grd.Cell(gr,TableColNumber.KeyName).Text}_场景编号{_grd.Cell(gr,TableColNumber.SceneID).Text}" devAddr =$"00400000{Server(0).ToString.Trim}" - insert= INSERTtbl_configured_devlist(HotelID,RoomTypeID,_grd.Cell(gr,TableColNumber.KeyName).Text,devAddr) + insert= INSERTtbl_configured_devlist(HotelID,RoomTypeID,bumberstr,devAddr) If dic.ContainsKey(devAddr) Then Else dic.Add(devAddr,insert) @@ -7257,7 +7259,8 @@ ON DUPLICATE KEY UPDATE {updatastr};" Server= _grd.Cell(gr,TableColNumber.ServerAttribute).Text.Trim.Split(",") If IsNothing(Server) OrElse Server.Count=0 OrElse string.IsNullOrEmpty(Server(0)) Then Continue For devAddr =$"004000001" - insert= INSERTtbl_configured_devlist(HotelID,RoomTypeID,_grd.Cell(gr,TableColNumber.KeyName).Text,devAddr) + bumberstr=$"{_grd.Cell(gr,TableColNumber.KeyName).Text}_场景编号{_grd.Cell(gr,TableColNumber.SceneID).Text}" + insert= INSERTtbl_configured_devlist(HotelID,RoomTypeID,bumberstr,devAddr) If dic.ContainsKey(devAddr) Then Else dic.Add(devAddr,insert) @@ -7271,7 +7274,7 @@ ON DUPLICATE KEY UPDATE {updatastr};" ' 485(轮询)1 '设备地址:9 'A9恒压调光_(RS485_轮询) - Dim str As String = dev.Desc.Name + Dim str As String = dev.Name Dim strbuf() As String = str.Split(vbLf) If strbuf.Count > 1 Then Dim strbuf1() As String = strbuf(1).Trim.Split(":") @@ -7297,7 +7300,8 @@ ON DUPLICATE KEY UPDATE {updatastr};" insert= INSERTtbl_configured_devlist(HotelID,RoomTypeID,dev.Name.Replace(vbLf,"_")&"_主机",devAddr) Else devname=dev.Name.Split (vbLf) - insert= INSERTtbl_configured_devlist(HotelID,RoomTypeID,devname(2),devAddr) + devnamestr=$"{devname(2)}_地址{typeindex}" + insert= INSERTtbl_configured_devlist(HotelID,RoomTypeID,devnamestr,devAddr) End If If dic.ContainsKey(devAddr) Then