增加杨格锁私有属性编译和优化解析HEX文件逻辑
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user