diff --git a/BLV_Studio/BLV_Studio.vbproj b/BLV_Studio/BLV_Studio.vbproj index 1c8c1a1..53af77a 100644 --- a/BLV_Studio/BLV_Studio.vbproj +++ b/BLV_Studio/BLV_Studio.vbproj @@ -35,7 +35,7 @@ 4.0.0.5 true index.html - 82 + 85 4.4.3.%2a false true diff --git a/BLV_Studio/Control/FrmCSeriesConfig.vb b/BLV_Studio/Control/FrmCSeriesConfig.vb index 87b5332..fef944a 100644 --- a/BLV_Studio/Control/FrmCSeriesConfig.vb +++ b/BLV_Studio/Control/FrmCSeriesConfig.vb @@ -8756,7 +8756,8 @@ Public Class FrmCSeriesConfig '偏移地址 0x04 数据类型指示偏移地址 Dim LineAddOffestBase As Integer = 0 - + '’偏移地址 0x02 数据类型指示偏移地址 + Dim LineAddOffestBase2 As Integer = 0 '结束地址 endAddr = 0 @@ -8802,7 +8803,7 @@ Public Class FrmCSeriesConfig '本行地址取出来放在 flashAddress中’ StrToHex(tmpLineAdd, flashAddressBuf) - flashAddress = LineAddOffestBase + tmpLineAdd + flashAddress = LineAddOffestBase + tmpLineAdd + LineAddOffestBase2 'B3:数据类型 Dim dataType = StrToHex(hexBuffer(i + 8)) @@ -8822,8 +8823,19 @@ Public Class FrmCSeriesConfig Else Return True End If - Case 2, 3, 5 '扩展段地址, 开始段地址, 开始线性地址’ + Case 3, 5 '扩展段地址, 开始段地址, 开始线性地址’ 4 '扩展线性地址 Continue For + Case 2 ', + If dataLen = 2 Then + + LineAddOffestBase2 = (dataValBuf(0) * 256 + dataValBuf(1)) + + LineAddOffestBase2 = LineAddOffestBase2 << 4 + Else + 'resultli.Analysis = "文件偏移地址异常!!" + Return False '确认DataLen必须是2,否则报错’ + End If + Case 4 '扩展线性地址 If dataLen = 2 Then LineAddOffestBase = (dataValBuf(0) * 256 + dataValBuf(1)) * 65536 diff --git a/BLV_Studio/My Project/AssemblyInfo.vb b/BLV_Studio/My Project/AssemblyInfo.vb index cb95d80..74e1613 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.vb b/BLV_Studio/SetLoopInformation.vb index 0c54745..5fcf843 100644 --- a/BLV_Studio/SetLoopInformation.vb +++ b/BLV_Studio/SetLoopInformation.vb @@ -55,6 +55,8 @@ Public Class SetLoopInformation PB20_RELAY = 33 ColorTemp = 34 + + PB_STRIP = 50 CarbonVIP = 54 End Enum @@ -373,6 +375,8 @@ Public Class SetLoopInformation result = "色温" Case DeviceType.CarbonVIP result = "碳达人" + Case DeviceType.PB_STRIP + result = "PB调光" Case Else result = "未知设备" diff --git a/BLV_Studio/Test/GridTest/AddPeripherals.Designer.vb b/BLV_Studio/Test/GridTest/AddPeripherals.Designer.vb index da67448..455bfc1 100644 --- a/BLV_Studio/Test/GridTest/AddPeripherals.Designer.vb +++ b/BLV_Studio/Test/GridTest/AddPeripherals.Designer.vb @@ -60,6 +60,7 @@ Partial Class AddPeripherals Me.Grid1 = New FlexCell.Grid() Me.Temp_Grid = New FlexCell.Grid() Me.Button1 = New System.Windows.Forms.Button() + Me.ComboBox2 = New System.Windows.Forms.ComboBox() CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainer1.Panel1.SuspendLayout() Me.SplitContainer1.Panel2.SuspendLayout() @@ -142,6 +143,7 @@ Partial Class AddPeripherals ' 'SplitContainer2.Panel1 ' + Me.SplitContainer2.Panel1.Controls.Add(Me.ComboBox2) Me.SplitContainer2.Panel1.Controls.Add(Me.TextBox3) Me.SplitContainer2.Panel1.Controls.Add(Me.Label9) Me.SplitContainer2.Panel1.Controls.Add(Me.CheckBox6) @@ -567,6 +569,17 @@ Partial Class AddPeripherals Me.Button1.Text = "确定" Me.Button1.UseVisualStyleBackColor = True ' + 'ComboBox2 + ' + Me.ComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.ComboBox2.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte)) + Me.ComboBox2.FormattingEnabled = True + Me.ComboBox2.Location = New System.Drawing.Point(1134, 86) + Me.ComboBox2.Name = "ComboBox2" + Me.ComboBox2.Size = New System.Drawing.Size(54, 24) + Me.ComboBox2.TabIndex = 28 + Me.ComboBox2.Visible = False + ' 'AddPeripherals ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!) @@ -645,4 +658,5 @@ Partial Class AddPeripherals Friend WithEvents Button2 As Button Friend WithEvents Label9 As Label Friend WithEvents TextBox3 As TextBox + Friend WithEvents ComboBox2 As ComboBox End Class diff --git a/BLV_Studio/Test/GridTest/AddPeripherals.vb b/BLV_Studio/Test/GridTest/AddPeripherals.vb index e328e44..59d1ad2 100644 --- a/BLV_Studio/Test/GridTest/AddPeripherals.vb +++ b/BLV_Studio/Test/GridTest/AddPeripherals.vb @@ -34,6 +34,7 @@ Public Class AddPeripherals Dev_ColorTemp BLEMUSIC RS485_Curtain + LOCK max End Enum Enum Tcolname @@ -253,7 +254,7 @@ Public Class AddPeripherals Fdevtype.Visible = False FdevtypeCom.Visible = False SplitContainer6.Visible = False - + ComboBox2.Visible = False If Not String.IsNullOrEmpty(Resultmodel.Desc.DevDescription) Then Dim Rchenk() As String = Resultmodel.Desc.DevDescription.Split(",") @@ -319,7 +320,26 @@ Public Class AddPeripherals CURTAIN_initTable(_despar) CURTAIN_SetIDOpenDO() + Case FromDevType.LOCK + Dim DevDescription As String() = Resultmodel.Desc.DevDescription.Split(",") + Label9.Visible = True + Label9.Text = "开锁有效期" + TextBox3.Visible = True + TextBox3.Enabled = True + ComboBox2.Visible = True + ComboBox2.Items.Clear() + ComboBox2.Items.Add("不设置") + ComboBox2.Items.Add("秒") + ComboBox2.Items.Add("分") + If DevDescription.Length > 1 Then + TextBox3.Text = DevDescription(0) + ComboBox2.SelectedIndex = DevDescription(1) + Else + TextBox3.Text = "0" + ComboBox2.SelectedIndex = 0 + End If + SplitContainer4.Panel2Collapsed = True Case FromDevType.BLEMUSIC SplitContainer4.Panel2Collapsed = True Label9.Visible = True @@ -700,8 +720,10 @@ Public Class AddPeripherals CheckBox4.Visible = True Return FromDevType.Temp Case "BLEMUSIC" - Return FromDevType.BLEMUSIC + Case "Lock" + Return FromDevType.LOCK + Case "RS485_Curtain" Return FromDevType.RS485_Curtain Case "CURTAIN" @@ -732,7 +754,7 @@ Public Class AddPeripherals Private Sub SelectiveDisplay() g_DevType = DetermineDeviceType() - + ComboBox2.Visible = False ComboBox1.Visible = False Label6.Visible = False Table_Grid1.Visible = False @@ -812,6 +834,26 @@ Public Class AddPeripherals Table_Grid1.Visible = True SplitContainer4.Panel2Collapsed = True CURTAIN_initTable(_despar) + Case FromDevType.LOCK + Dim DevDescription As String() = Resultmodel.Desc.DevDescription.Split(",") + Label9.Visible = True + Label9.Text = "开锁有效期" + TextBox3.Visible = True + TextBox3.Enabled = True + + ComboBox2.Visible = True + ComboBox2.Items.Clear() + ComboBox2.Items.Add("不设置") + ComboBox2.Items.Add("秒") + ComboBox2.Items.Add("分") + If DevDescription.Length > 1 Then + TextBox3.Text = DevDescription(0) + ComboBox2.SelectedIndex = DevDescription(1) + Else + TextBox3.Text = "0" + ComboBox2.SelectedIndex = 0 + End If + SplitContainer4.Panel2Collapsed = True Case FromDevType.BLEMUSIC SplitContainer4.Panel2Collapsed = True Label9.Visible = True @@ -1317,6 +1359,29 @@ Public Class AddPeripherals Else Resultmodel.Desc.DevDescription = $"{ Resultmodel.Desc.DevDescription},0" End If + Case FromDevType.LOCK + Dim ntstyr As String + '判断 TextBox3.Text是否为空,如果为空则赋值为"0",否则赋值为TextBox3.Text.Trim + If String.IsNullOrEmpty(TextBox3.Text) Then + ntstyr = "0" + Else + ntstyr = TextBox3.Text.Trim + End If + '获取ComboBox2的值如果为秒范围为 1-60,如果为分范围为 1-5,如果不设置则无范围 + Dim range As String = ComboBox2.Text.Trim + If range = "秒" Then + If Not (1 <= ntstyr AndAlso ntstyr <= 60) Then + MsgBox("请输入1-60之间的数字") + Return + End If + ElseIf range = "分" Then + If Not (1 <= ntstyr AndAlso ntstyr <= 5) Then + MsgBox("请输入1-5之间的数字") + Return + End If + End If + + Resultmodel.Desc.DevDescription = $"{ntstyr},{ComboBox2.SelectedIndex}" Case FromDevType.PB_Bus ResdultPB_Bus() diff --git a/BLV_Studio/Test/GridTest/TableInteraction.vb b/BLV_Studio/Test/GridTest/TableInteraction.vb index 5b3da75..217ec12 100644 --- a/BLV_Studio/Test/GridTest/TableInteraction.vb +++ b/BLV_Studio/Test/GridTest/TableInteraction.vb @@ -6558,6 +6558,7 @@ Public Class TableInteraction Dim tmpAddr As Byte = CInt(FindAttributeValueUnderModel2(pNode, "设备存在", "拨码地址")) '设备地址(1字节) Dim hostAddr As Byte = CInt(FindNodeValueUnderModel(hostNode, "RS485", pNode.Desc.DevInterface)) '设备地址(1字节) Dim TemptDevType As Byte = 0 + Dim T1TemptDevType As Byte = 0 Dim ParentDevType As Byte = 0 Dim ParentDevAddr As Byte = 0 Dim ParentDevPort As Byte = 0 @@ -6599,14 +6600,29 @@ Public Class TableInteraction End If End If + If Tcnode.Name.ToUpper.Equals("LOCK") And Not IsNothing(pNode.Desc.DevDescription) Then + Curtainbuf= pNode.Desc.DevDescription.split(",") + If Curtainbuf.Length > 1 Then + + T1TemptDevType =CInt(Curtainbuf(1)) + + If T1TemptDevType=0 Then + TemptDevType = 0 + Else + TemptDevType=CInt(Curtainbuf(0)) + End If + Exit For + End If + + End If Next keepParam(0) = ParentDevType keepParam(1) = ParentDevAddr keepParam(2) = ParentDevPort - keepParam(8) = TemptDevType - + keepParam(8) =T1TemptDevType + keepParam(9) = TemptDevType For indexi = 1 To 5 node = FindAttributeUnderModel(pNode, "设备存在", $"弱电输入{indexi}") If node Then