(CL3000)VB.Net:获取数据结构ProgItemType内容

1、获取ProgItemType中的Flag项

'ProgItemType Flag
    Public Function GetProgItemType_Flag(ByVal Area As Integer, ByVal FileType As Integer, ByVal FileTypeNo As Integer) As Short
        Dim stemp As Integer = (FileTypeNo << 6) + (FileType << 2) + Area
        'Dim btemp() As Byte = iByte2H(itemp)
        Return stemp
    End Function

2、获取ProgItemType中的PicFIndex项


    'ProgItemType PicFIndex
    Public Function GetProgItemType_PicFIndex(ByVal PicFIndex As Integer) As Short
        Dim stemp As Integer = PicFIndex
        'Dim btemp() As Byte = iByte2H(itemp)
        Return stemp
    End Function

3、获取ProgItemType中的Effect项

    'ProgItemType Effect
    Public Function GetProgItemType_Effect(ByVal Effin As Integer, ByVal Effout As Integer) As Integer
        Dim itemp As Integer = (Effout << 6) + Effin
        'Dim btemp() As Byte = iByte4H(itemp)
        Return itemp
    End Function

4、获取ProgItemType中的SpeedStay项

    'ProgItemType SpeedStay
    Public Function GetProgItemType_SpeedStay(ByVal Speedin As Integer, ByVal Speedout As Integer, ByVal Stay As Integer) As Integer
        Dim itemp As Integer = (Stay << 8) + (Speedout << 4) + Speedin
        'Dim btemp() As Byte = iByte4H(itemp)
        Return itemp
    End Function

5、获取ProgItemType中的Schedule项


    'ProgItemType Schedule
    Public Function GetProItemType_Schedule(ByVal OnMinute As Integer, ByVal OnHour As Integer, ByVal OffMinute As Integer, ByVal OffHour As Integer, ByVal Week As Integer) As Integer
        Dim itemp As Integer = (Week << 25) + (7 << 22) + (OffHour << 17) + (OnHour << 12) + (OffMinute << 6) + (OnMinute)
        'Dim btemp() As Byte = iByte4H(itemp)
        Return itemp
    End Function

6、获取ProgItemType内容

 '获取 ProgItemType
    Public Function GetProgItemType(ByVal Flag As Short, ByVal PicFIndex As Short, ByVal Effect As Integer, ByVal SpeedStay As Integer, ByVal Schedule As Integer) As Byte()
        Dim btemp(16) As Byte

        Dim i As Integer
        For i = 0 To iByte2H(Flag).Length - 1
            btemp(i) = iByte2H(Flag)(i)
        Next
        For i = 2 To i + iByte2H(PicFIndex).Length - 1
            btemp(i) = iByte2H(PicFIndex)(i - 2)
        Next
        For i = 4 To i + iByte4H(Effect).Length - 1
            btemp(i) = iByte4H(Effect)(i - 4)
        Next
        For i = 8 To i + iByte4H(SpeedStay).Length - 1
            btemp(i) = iByte4H(SpeedStay)(i - 8)
        Next
        For i = 12 To i + iByte4H(Schedule).Length - 1
            btemp(i) = iByte4H(Schedule)(i - 12)
        Next
        Return btemp
    End Function

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值