?? otherequ.vb
字號:
'**********************其他設備公共類**************************
'***********修改時間:2007年8月12日
'***********編寫人:鮑輝
'***********針對與廣西聯正達合作的機房遠控系統
'***********包括設備類型:N+1切換器1臺(康特)、信號源切換器12臺(成都泰立)、防非信號接收機3臺(成都泰立)、
'***********KS-L采集器4臺(北京昆侖海岸)、柴油發電機(SW)1臺
Imports System.Math
'Imports System.String
Imports Microsoft.VisualBasic.Strings
Imports TransmitTV.Transmitter
Imports TransmitTV.LoadData
Public Class OtherEqu
Dim i As Integer
Public iTransmitID As Integer '''設備編號
Public strTransmitName As String '''設備名稱
Public iTraType As Integer '''設備廠家類型 6-采集器,7-信號源切換器,8-防非接收機,9-發電機,10-N+1切換器
Public strTransmitModel As String '''設備型號
Public strTransmitAddr As String '''設備地址 RS232編碼地址
Public iTransmitType As Integer '''默認值為0
Public strTransmitPower As String '''默認值為空
Public iMainExciter As Integer '''默認值為0
Public iStandbyExciter As Integer '''默認值為0
Public iAmpCount As Integer '''默認值為0
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 bFirst As Boolean '''定義是否第一次保存記錄
Public Nand1Switch As Nand1SwitchUnit '''定義N+1切換器
Public SignalSwitch As SignalSwitchEqu '''定義信號源切換器
Public RecepDevice As RecepDeviceEqu '''定義防非接收機
Public Collection As CollectionEqu '''定義采集器
Public Dieselmotor As DieselmotorEqu '''定義柴油發電機
Public iLastSaveTime As Long '''定義上次數據保存的時間
Public iCommStatus As Integer '''通訊狀態
Public iId As Int64
Public iTempflag As Integer
Public a1, b1, a2, b2 As Integer
Public Sub New()
iTransmitID = 0
strTransmitName = ""
iTraType = 0
strTransmitModel = ""
strTransmitAddr = ""
iTransmitType = 0
strTransmitPower = ""
iMainExciter = 0
iStandbyExciter = 0
iAmpCount = 0
iPort = 0
strPortPara = ""
iCommType = 0
iTempflag = 0
iState = 0
iId = 0
bOpenClose = False
bFirst = True
iCommStatus = 0
Nand1Switch = New Nand1SwitchUnit
SignalSwitch = New SignalSwitchEqu
RecepDevice = New RecepDeviceEqu
Collection = New CollectionEqu
Dieselmotor = New DieselmotorEqu
ReDim Collection.dAinPort(7)
ReDim Collection.bDinPort(15)
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 First() As Boolean
Get
Return bFirst
End Get
Set(ByVal value As Boolean)
bFirst = 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 Tempflag() As Integer
Get
Return iTempflag
End Get
Set(ByVal Value As Integer)
iTempflag = 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) '''''''''數據解包
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
Select Case iTraType '''設備類型(6-采集器,7-信號源切換器,8-防非接收機,9-發電機,10-N+1切換器)
Case 6 '''采集器
'''由于采集器是按ASCII碼發送,接收數據為字符串,所以不在此過程中處理
Case 7 '''信號源切換器
'''信號源切換器的開關量采集數據全部由采集器完成
'''他的切換控制命令沒有返回數據
Case 8 '''防非接收機
If btData(0) <> 90 Then Exit Sub '''''同步字節
If UBound(btData) > 0 Then
Select Case btData(0)
Case 17, 34, 51
RecepParse(btData)
Case 90
CommStatus = 1
Exit Sub
Case Else
RecepDeviceParse(btData)
End Select
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -