优化当固件版本大于43时开关机提示音和风速提示音的组包方式
This commit is contained in:
@@ -1551,6 +1551,9 @@ Public Class TableInteraction
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'设置到弹窗显示
|
||||
Dim from1 As New AddPeripherals
|
||||
from1.g_Devicemodel = Dic_Devicemodel
|
||||
@@ -1566,6 +1569,7 @@ Public Class TableInteraction
|
||||
from1.g_DevScenenumber = GetSceneNumbeAr()
|
||||
from1.g_ColumnAnothername = ColumnAnothername
|
||||
from1.EditFeedbackLamp(rvdicv, devmodw)
|
||||
|
||||
If from1.ShowDialog() <> DialogResult.OK Then Return
|
||||
'根据弹窗设置重新设置界面置
|
||||
|
||||
@@ -2867,7 +2871,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())
|
||||
@@ -2886,7 +2890,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)
|
||||
@@ -4134,7 +4138,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())
|
||||
@@ -4259,8 +4263,25 @@ Public Class TableInteraction
|
||||
Dbuf = dic.Item([Enum].GetName(GetType(AddPeripherals.Temproweven), AddPeripherals.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
|
||||
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
|
||||
@@ -4268,6 +4289,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)
|
||||
@@ -4323,6 +4346,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([Enum].GetName(GetType(AddPeripherals.Temproweven), AddPeripherals.Temproweven.互锁)).Trim.Split("*")
|
||||
ncbuf.Add(GetActionData(DeviceModuleDic, hostname, "MUSIC", 1, "0,2,3,1,12,0"))
|
||||
@@ -4332,6 +4371,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)
|
||||
@@ -6190,7 +6230,7 @@ Public Class TableInteraction
|
||||
Public Voicement As List(Of DeviceModel)
|
||||
Public devTempment 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)
|
||||
@@ -6285,7 +6325,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
|
||||
|
||||
Reference in New Issue
Block a user