⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transmitktd.vb

📁 广西百色247台电视发射机监控源代码.已经过实践
💻 VB
📖 第 1 页 / 共 4 页
字号:
'**********************康特数字广播电视发射机类***************************
'***********修改时间:2007年8月10日
'***********编写人:鲍辉
'***********针对与广西联正达合作的机房远控系统
Imports System.Math
'Imports System.String
Imports Microsoft.VisualBasic.Strings
Imports TransmitTV.Transmitter
Imports TransmitTV.PublicClass
Imports TransmitTV.Send
Imports TransmitTV.LoadData
Public Class TransmitKTD
    Dim i As Integer
    Public iTransmitID As Integer        '''发射机编号
    Public strTransmitName As String     '''发射机名称
    Public iTraType As Integer           '''发射机厂家类型1-康特,2-凯腾,3-吉兆,4-北广,5-金网通
    Public strTransmitModel As String    '''发射机型号
    Public strTransmitAddr As String     '''发射机地址 康特为IP地址,其他厂家发射机均为RS232编码地址
    Public iTransmitType As Integer      '''发射机传输类型 1-电视,2-调频,3-数字
    Public strTransmitPower As String    '''发射机功率等级
    Public iMainExciter As Integer       '''主激励器类型 1-RVR,2-EKA,3-对应厂家激励器
    Public iStandbyExciter As Integer    '''备激励器类型 1-RVR,2-EKA,3-对应厂家激励器
    Public iAmpCount As Integer          '''功放插件数
    Public iPort As Integer              '''对应串口号
    Public strPortPara As String         '''串口通讯参数
    Public iCommType As Integer          '''通讯方式 1-232,2-485,3-TCP/IP
    Public iState As Integer             '''0-正常,1-报警,2-停用
    Public bOpenClose As Boolean
    Public Master As MasterUnit          '''定义主控单元
    Public Amplifier() As AmplifierUnit  '''定义功放单元数组
    Public Insprt() As InspiritUnit      '''定义激励器数组(康特电视发射机)
    Public RVRInspirit() As RVRInspiritUnit '''定义RVR激励器数组( 康特调频发射机)
    Public Switch As SwitchUnit          '''定义开关控制单元(康特)
    Public iLastSaveTime As Long         '''定义上次数据保存的时间
    Public bFirst As Boolean             '''定义是否第一次保存记录
    Dim a As Double                      '''康特发射机功率修正值1
    Dim b As Double                      '''康特发射机功率修正值2
    Public iCommStatus As Integer        '''通讯状态
    Public iId As Int64
    Public iTempflag As Integer
    'Public bFirst As Boolean
    ' Public OnOff As autoOpenClose       '''定义自动开关机
    Public Monday() As String
    Public Tuesday() As String
    Public Wednesday() As String
    Public Thursday() As String
    Public Friday() As String
    Public Saturday() As String
    Public Sunday() As String
    Public ParaLowOrHigh As ParaLowOrHighCls
    Public Sub New()
        iTransmitID = 0
        strTransmitName = ""
        iTraType = 0
        strTransmitModel = ""
        strTransmitAddr = ""
        iTransmitType = 0
        strTransmitPower = ""
        iMainExciter = 0
        iStandbyExciter = 0
        iAmpCount = 0
        iPort = 0
        strPortPara = ""
        iCommType = 0
        iState = 0
        bOpenClose = False
        iCommStatus = 2 '''默认状态 未连接
        iId = 0
        bFirst = True
        iTempflag = 0
        Master = New MasterUnit
        ReDim Amplifier(7)
        For i = 0 To 7
            Amplifier(i) = New AmplifierUnit
        Next
        ReDim Insprt(1)
        ReDim RVRInspirit(1)
        For i = 0 To 1
            Insprt(i) = New InspiritUnit
            RVRInspirit(i) = New RVRInspiritUnit
        Next
        Switch = New SwitchUnit
        ' bFirst = True
        ReDim Monday(1)
        ReDim Tuesday(3)
        ReDim Wednesday(1)
        ReDim Thursday(1)
        ReDim Friday(1)
        ReDim Saturday(1)
        ReDim Sunday(1)
        ParaLowOrHigh = New ParaLowOrHighCls
    End Sub
    Public Property TransmitID() As Integer
        Get
            Return iTransmitID
        End Get
        Set(ByVal Value As Integer)
            iTransmitID = Value
        End Set
    End Property
    Public Property TransmitName() As String
        Get
            Return strTransmitName
        End Get
        Set(ByVal Value As String)
            strTransmitName = Value
        End Set
    End Property
    Public Property TraType() As Integer
        Get
            Return iTraType
        End Get
        Set(ByVal Value As Integer)
            iTraType = Value
        End Set
    End Property
    Public Property TransmitModel() As String
        Get
            Return strTransmitModel
        End Get
        Set(ByVal Value As String)
            strTransmitModel = Value
        End Set
    End Property
    Public Property TransmitAddr() As String
        Get
            Return strTransmitAddr
        End Get
        Set(ByVal Value As String)
            strTransmitAddr = Value
        End Set
    End Property
    Public Property TransmitType() As Integer
        Get
            Return iTransmitType
        End Get
        Set(ByVal Value As Integer)
            iTransmitType = Value
        End Set
    End Property
    Public Property TransmitPower() As String
        Get
            Return strTransmitPower
        End Get
        Set(ByVal Value As String)
            strTransmitPower = Value
        End Set
    End Property
    Public Property MainExciter() As Integer
        Get
            Return iMainExciter
        End Get
        Set(ByVal Value As Integer)
            iMainExciter = Value
        End Set
    End Property
    Public Property StandbyExciter() As Integer
        Get
            Return iStandbyExciter
        End Get
        Set(ByVal Value As Integer)
            iStandbyExciter = Value
        End Set
    End Property
    Public Property AmpCount() As Integer
        Get
            Return iAmpCount
        End Get
        Set(ByVal Value As Integer)
            iAmpCount = Value
        End Set
    End Property
    Public Property Port() As Integer
        Get
            Return iPort
        End Get
        Set(ByVal Value As Integer)
            iPort = Value
        End Set
    End Property
    Public Property PortPara() As String
        Get
            Return strPortPara
        End Get
        Set(ByVal Value As String)
            strPortPara = Value
        End Set
    End Property
    Public Property CommType() As Integer
        Get
            Return iCommType
        End Get
        Set(ByVal Value As Integer)
            iCommType = Value
        End Set
    End Property
    Public Property State() As Integer
        Get
            Return iState
        End Get
        Set(ByVal Value As Integer)
            iState = Value
        End Set
    End Property
    Public Property OpenClose() As Boolean
        Get
            Return bOpenClose
        End Get
        Set(ByVal value As Boolean)
            bOpenClose = value
        End Set
    End Property
    Public Property First() As Boolean
        Get
            Return bFirst
        End Get
        Set(ByVal value As Boolean)
            bFirst = value
        End Set
    End Property
    Public Property CommStatus() As Integer
        Get
            Return iCommStatus
        End Get
        Set(ByVal Value As Integer)
            iCommStatus = Value
        End Set
    End Property
    Public Property Id() As Integer
        Get
            Return iId
        End Get
        Set(ByVal Value As Integer)
            iId = Value
        End Set
    End Property
    Public Sub parse(ByRef btData() As Byte, ByVal bytesRec As Integer, ByVal CommandType As Integer)    '''''''''数据解包
        Dim tempData() As Byte
        'Try
        '''''''按字节对应解析 btData-应答数据数组,bytesRec-返回数据长度
        If btData(0) <> 85 Or btData(1) <> 170 Then Exit Sub '''''同步字节
        CommStatus = 1
        Select Case btData(4)  '''''命令类型
            Case 6    '''''数据召唤
                If First = True Then  ''''第一次
                    First = False
                    iTempflag = 0
                    iLastSaveTime = Environment.TickCount
                Else
                    If Environment.TickCount - iLastSaveTime > dataSaveCycle * 1000 Then ''''原则上每间隔一小时保存一次

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -