?? transmitgme.vb
字號:
'**********************吉兆(GME)調頻電視發射機類***************************
'***********修改時間:2007年8月10日
'***********編寫人:鮑輝
'***********針對與廣西聯正達合作的機房遠控系統
Imports System.Math
'Imports System.String
Imports Microsoft.VisualBasic.Strings
Imports TransmitTV.Transmitter
Imports TransmitTV.PublicClass
Imports TransmitTV.LoadData
Public Class TransmitGME
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 GMEInspirit() As GMEInspiritUnit '''定義激勵器數組(吉兆電視C、D型激勵器)
Public RVRInspirit() As RVRInspiritUnit '''定義RVR激勵器數組(吉兆調頻)
Public EKAInspirit() As EKAInspiritUnit '''定義EKA激勵器數組(吉兆調頻)
Public InspiritManager As InspiritManagerUnit '''定義激勵器管理單元(只針對吉兆調頻發射機)
Public PSsystem As PSsystemUnit '''定義電控系統(吉兆調頻、電視)
Public iLastSaveTime As Long '''定義上次數據保存的時間
Public bFirst As Boolean '''定義是否第一次保存記錄
Public iCommStatus As Integer '''通訊狀態
Public iId As Int64
Public iTempflag As Integer
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
iId = 0
bOpenClose = False
iCommStatus = 2 '''默認狀態 未連接
iTempflag = 0
bFirst = True
Master = New MasterUnit
ReDim Amplifier(19)
For i = 0 To 19
Amplifier(i) = New AmplifierUnit
Next
ReDim GMEInspirit(1)
ReDim RVRInspirit(1)
ReDim EKAInspirit(1)
For i = 0 To 1
GMEInspirit(i) = New GMEInspiritUnit
RVRInspirit(i) = New RVRInspiritUnit
EKAInspirit(i) = New EKAInspiritUnit
Next
InspiritManager = New InspiritManagerUnit
PSsystem = New PSsystemUnit
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 Id() As Integer
Get
Return iId
End Get
Set(ByVal Value As Integer)
iId = Value
End Set
End Property
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 Sub parse(ByRef btData() As Byte, ByVal bytesRec As Integer, ByVal CommandType As Integer) '''''''''數據解包
Dim tempData() As Byte
'Try
'''''''按字節對應解析 btData-應答數據數組,bytesRec-返回數據長度
'''''''按發射機種類解碼
If First = True Then ''''第一次
First = False
iTempflag = 0
iLastSaveTime = Environment.TickCount
Else
If Environment.TickCount - iLastSaveTime > dataSaveCycle * 1000 Then ''''原則上每間隔一小時保存一次
iTempflag = 0
iLastSaveTime = Environment.TickCount
Else
iTempflag = 1
'iLastSaveTime = Environment.TickCount
End If
End If
CommStatus = 1
Select Case TransmitType '''發射機類型
Case 1 '''吉兆電視發射機 gme
If btData(0) <> Val("&H" + strTransmitAddr) Then Exit Sub '''''發射機地址
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -