优化当固件版本大于43时开关机提示音和风速提示音的组包方式

This commit is contained in:
2026-03-05 17:23:36 +08:00
parent 0bf7fdecf4
commit f61b4beb3f
3 changed files with 60 additions and 8 deletions

View File

@@ -2805,7 +2805,7 @@ Public Class TableInteraction
#End Region
#Region "编译"
Public Function TableCompiletoByte(Optional savePath As String = "",
Public Function TableCompiletoByte(FVer As Integer,Optional savePath As String = "",
Optional ByVal IsShowCompileResult As Boolean = False,
Optional ByVal ifCfgVerPlusPlus As Boolean = False) As Boolean
Dim lst As New List(Of Byte())
@@ -2824,7 +2824,7 @@ Public Class TableInteraction
'编译设备存在
Dim deviceExistsDatas As List(Of Byte())
Dim OutDevlist As New List(Of Byte)
deviceExistsDatas = FillDeviceExistsData(Dic_Devicemodel)
deviceExistsDatas = FillDeviceExistsData(Dic_Devicemodel,FVer)
lst.AddRange(deviceExistsDatas.ToArray)
'获取编译的设备动作
Dim actibuf As List(Of Byte()) = FillDeviceObject(Dic_Devicemodel, Dic_ActionConfiguration, _grd)
@@ -4178,7 +4178,7 @@ Public Class TableInteraction
End Function
Private Function TempDeviceObject(ByRef Eventnumber As Integer, DeviceModuleDic As Dictionary(Of String DeviceModel) DevName As String, DevNodeName As String) As List(Of Byte())
Private Function TempDeviceObject(ByRef Eventnumber As Integer, DeviceModuleDic As Dictionary(Of String DeviceModel) DevName As String, DevNodeName As String,FVer As Integer) As List(Of Byte())
'返回变量
Dim result As New List(Of Byte())
Dim ncbuf As New List(Of Byte())
@@ -4303,8 +4303,25 @@ Public Class TableInteraction
Dbuf = dic.Item(GetDescriptionOriginalAddPeripherals.Temproweven.互锁)).Trim.Split("*")
ncbuf.Add(GetActionData(DeviceModuleDic, Dbuf(0), "Temp", Dbuf(1), "0,1,1,1,1,1,16"))
End If
If checkbuf(1).Equals("1") Then
'Dbuf = dic.Item(GetDescriptionOriginal( AddPeripherals.Temproweven.互锁)).Trim.Split("*")
If FVer >43 Then
Dim btxtr As string
Dim bctr As Integer=32
If checkbuf(0).Equals("1") Then
bctr=bctr or (1<<2)
End If
If checkbuf(3).Equals("1") Then
bctr=bctr or (1<<3)
End If
btxtr= $"0,2,0,2,1,0,0"
dim btxli As Byte()= GetActionData(DeviceModuleDic, DevName, "Temp", 1, btxtr)
btxli(5) = bctr
ncbuf.Add(btxli)
Else
If checkbuf(1).Equals("1") Then
'Dbuf = dic.Item([Enum].GetName(GetType(AddPeripherals.Temproweven), AddPeripherals.Temproweven.互锁)).Trim.Split("*")
ncbuf.Add(GetActionData(DeviceModuleDic, hostname, "MUSIC", 1, "0,2,3,1,11,0"))
End If
If checkbuf(3).Equals("1") Then
@@ -4312,6 +4329,8 @@ Public Class TableInteraction
Else
ncbuf.Add(GetActionData(DeviceModuleDic, DevName, "Temp", 1, "0,2,0,2,2,0,0"))
End If
End If
Case 2 '关机
UShort.TryParse(32, strEventNum)
@@ -4367,6 +4386,22 @@ Public Class TableInteraction
ncbuf.Add(GetActionData(DeviceModuleDic, Dbuf(0), "Temp", Dbuf(1), "0,1,1,1,1,1,16"))
End If
If FVer >43 Then
Dim btxtr As string
Dim bctr As Integer=32
If checkbuf(0).Equals("1") Then
bctr=bctr or (1<<2)
End If
If checkbuf(3).Equals("1") Then
bctr=bctr or (1<<3)
End If
btxtr= $"0,2,0,2,1,0,0"
dim btxli As Byte()= GetActionData(DeviceModuleDic, DevName, "Temp", 1, btxtr)
btxli(5) = bctr
ncbuf.Add(btxli)
Else
If checkbuf(1).Equals("1") Then
Dbuf = dic.Item(GetDescriptionOriginalAddPeripherals.Temproweven.互锁)).Trim.Split("*")
ncbuf.Add(GetActionData(DeviceModuleDic, hostname, "MUSIC", 1, "0,2,3,1,12,0"))
@@ -4377,6 +4412,7 @@ Public Class TableInteraction
Else
ncbuf.Add(GetActionData(DeviceModuleDic, DevName, "Temp", 1, "0,2,0,2,2,0,0"))
End If
End If
Case 3 '冷阀开
UShort.TryParse(1028, strEventNum)
eventNum = BitConverter.GetBytes(strEventNum)
@@ -6092,7 +6128,7 @@ Public Class TableInteraction
Public Voicement As List(Of DeviceModel)
Public devTempment As List(Of DeviceModel)
Public devRKEY As List(Of DeviceModel)
Public Function FillDeviceExistsData(ByRef DeviceModuleDic As Dictionary(Of String DeviceModel)) As List(Of Byte())
Public Function FillDeviceExistsData(ByRef DeviceModuleDic As Dictionary(Of String DeviceModel),Optional FVer As Integer =38) As List(Of Byte())
Dim resultDatas As New List(Of Byte())
Dim cmd As Byte = &H3
Dim buf As List(Of Byte)
@@ -6190,7 +6226,7 @@ Public Class TableInteraction
' resultDatas.AddRange(result.ToArray)
'Next
For Each node In devTempment
result = TempDeviceObject(T_SceneID, DeviceModuleDic, node.Name, "Temp")
result = TempDeviceObject(T_SceneID, DeviceModuleDic, node.Name, "Temp",FVer )
If IsNothing(result) Then Continue For
resultDatas.AddRange(result.ToArray)
Next