feat: 更新节能属性和服务行添加功能
- 在 EnergySavingAttribute.vb 中添加了全局亮度节能的字典初始化。 - 在 FrmMain.vb 中修改了 AddServiceRow 方法,增加了可选参数以支持显示标志。 - 在 PowerSupply.vb 中实现了删除和设置服务的功能,增强了对场景号的处理。 - 在 ServiceAttribute.vb 中增加了对服务类型的删除确认,避免误删系统服务。 - 更新了版本号至 4.4.5.42,并修改了相关的发布文件。
This commit is contained in:
@@ -9,7 +9,7 @@ Public Class ServiceAttribute
|
||||
Public G_input As String
|
||||
|
||||
Private g_dicComboBox1 As Dictionary(Of String, String)
|
||||
|
||||
Public g_diaplay As Boolean
|
||||
Public G_result As String
|
||||
Enum STcolname
|
||||
<Description("输入序号")>
|
||||
@@ -69,6 +69,7 @@ Public Class ServiceAttribute
|
||||
Dim buff() As String = datastr.Split(vbLf)
|
||||
Dim isok As Boolean
|
||||
For Each index In buff
|
||||
If String.IsNullOrEmpty(index) Then Continue For
|
||||
isok = False
|
||||
|
||||
Dim buf() As String = index.Split(",")
|
||||
@@ -115,6 +116,7 @@ Public Class ServiceAttribute
|
||||
Dim C1, C2, C3, C4 As String
|
||||
|
||||
For Each index In buff
|
||||
If String.IsNullOrEmpty(index) Then Continue For
|
||||
C1 = String.Empty
|
||||
C2 = String.Empty
|
||||
C3 = String.Empty
|
||||
@@ -389,6 +391,19 @@ Public Class ServiceAttribute
|
||||
|
||||
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
||||
If Table_Grid1.ActiveCell.Row > 0 Then
|
||||
'判断选中服务是否在25 到57区间
|
||||
Dim tstr As String = Table_Grid1.Cell(Table_Grid1.ActiveCell.Row, STcolname.服务类型).Text.Trim
|
||||
Dim arr As String() = tstr.Split(":")
|
||||
Dim LoopAddri As Integer = Integer.Parse(arr(0).Trim)
|
||||
If LoopAddri >= 25 AndAlso LoopAddri <= 57 Then
|
||||
'弹框二次删除确认
|
||||
If MessageBox.Show("该服务为系统服务,删除后可能导致系统异常,是否继续删除?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = DialogResult.Yes Then
|
||||
Table_Grid1.Row(Table_Grid1.ActiveCell.Row).Delete()
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
|
||||
Table_Grid1.Row(Table_Grid1.ActiveCell.Row).Delete()
|
||||
End If
|
||||
End Sub
|
||||
@@ -416,7 +431,27 @@ Public Class ServiceAttribute
|
||||
|
||||
|
||||
Case STcolname.服务类型
|
||||
Table_Grid1.ComboBox(e.Col).Items.AddRange(Dic_1.ToArray)
|
||||
|
||||
For Each item In Dic_1
|
||||
'切割字符串(item) 提取LoopAddr
|
||||
Dim arr As String() = item.Split(":")
|
||||
'判斷 g_display
|
||||
If g_diaplay Then
|
||||
|
||||
Else
|
||||
'将arr(0)转为int
|
||||
Dim LoopAddri As Integer = Integer.Parse(arr(0).Trim)
|
||||
'過濾掉arr >= 25 AndAlso Node.LoopAddr <= 57
|
||||
If LoopAddri >= 25 AndAlso LoopAddri <= 57 Then
|
||||
Continue For
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Table_Grid1.ComboBox(e.Col).Items.Add(item)
|
||||
Next
|
||||
'Table_Grid1.ComboBox(e.Col).Items.AddRange(Dic_1.ToArray)
|
||||
|
||||
Case Else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user