📄 loaddata.vb
字号:
'**********************加载设备信息、控制指令等系统数据类***************************
'***********编写时间:2007年8月9日
'***********编写人:鲍辉
'***********针对与广西联正达合作的机房远控系统
Imports TransmitTV.Transmitter
Public Class LoadData
Public Shared TransGME() As TransmitGME '''创建吉兆发射机对象数组(5个)
Public Shared TransKTD() As TransmitKTD '''创建康特发射机对象数组(2个)
Public Shared TransKT() As TransmitKT '''创建凯腾、北广、金网通发射机对象数组(5个)
Public Shared Nand1() As OtherEqu '''创建N+1控制对象(1个)
Public Shared OtherDev() As OtherEqu '''创建信号源切换器、防非接收机、发电机、采集器(20个)
Public Shared OpenClose() As OpenClose
Public Shared ControlCmd() As ControlCmd
Public Shared SourceSwitchDev() As OtherEqu
''''''系统参数
Public Shared seekCycle As Integer '''通讯平台寻检设备周期
Public Shared dbCycle As Integer '''数据库刷新时间
Public Shared dataSaveCycle As Integer '''数据库保存间隔时间
Public Shared isAutoOff As Boolean '''是否自动开关机
Public Shared isN1 As Boolean '''是否启用N+1自动切换
Public Shared isSignal As Boolean '''是否启用信号源自动切换
Public Shared preEquNum As Integer '''N+1备机的编号
'''''''报警门限
Public Shared powerPoint As Double '''最低功率报警门限
Public Shared VswrPoint As Double '''驻波比报警
Public Shared TempPoint As Double '''发射机温度报警
Public Shared envTempPoint As Double '''环境温度报警
Public Shared envHumPoint As Double '''环境湿度报警
'Public Shared n1EquNum As Integer '''N+1切换器的编号
'Public Shared Cyc As MoreThread
' Public Shared moRS232 As Rs232
''*****************************'加载康特电视发射机基本信息******************************
Public Shared Sub LoadTransmitKTD()
Dim QueryString As String
Dim i As Integer
Dim ds As DataSet
QueryString = "select * from equipments where equType=1 and traType=1"
Try
ds = search.query(QueryString)
If ds.Tables(0).Rows.Count > 0 Then '''''动态数组
ReDim TransKTD(ds.Tables(0).Rows.Count - 1)
For i = 0 To ds.Tables(0).Rows.Count - 1
'''''''''''''''''''初始化设备信息
TransKTD(i) = New TransmitKTD
TransKTD(i).TransmitID = ds.Tables(0).Rows(i).Item("equNum") '''设备编号
TransKTD(i).TransmitName = ds.Tables(0).Rows(i).Item("equName") '''设备名称
TransKTD(i).TraType = ds.Tables(0).Rows(i).Item("equType") '''设备厂家类型
TransKTD(i).TransmitPower = ds.Tables(0).Rows(i).Item("equPower") '''功率类型
TransKTD(i).TransmitModel = ds.Tables(0).Rows(i).Item("equModel") '''设备型号
TransKTD(i).TransmitAddr = ds.Tables(0).Rows(i).Item("equAddress") '''设备地址
TransKTD(i).TransmitType = ds.Tables(0).Rows(i).Item("traType") '''发射机类型
TransKTD(i).MainExciter = ds.Tables(0).Rows(i).Item("equMainExcType") '''主激励器类型
TransKTD(i).StandbyExciter = ds.Tables(0).Rows(i).Item("equStandbyExcType") '''备激励器类型
TransKTD(i).AmpCount = ds.Tables(0).Rows(i).Item("unitCount") '''功放插件个数
TransKTD(i).Port = ds.Tables(0).Rows(i).Item("port") '''对应通讯串口号
TransKTD(i).PortPara = ds.Tables(0).Rows(i).Item("portPara") '''通讯参数
TransKTD(i).CommType = ds.Tables(0).Rows(i).Item("commType") '''通讯方式
TransKTD(i).State = ds.Tables(0).Rows(i).Item("state") '''设备状态
If Trim(ds.Tables(0).Rows(i).Item("equName")) = "N+1备机" Then
preEquNum = ds.Tables(0).Rows(i).Item("equNum")
End If
'LoadOpenClose(TransKTD(i))
Next
Else
MessageBox.Show("没有找到符合条件的设备记录。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End Try
End Sub
''*****************************'加载发射机每日自动开关机时间表**************************
Public Shared Sub LoadOpenClose(ByVal trans As Object)
Dim QueryString As String
Dim ds As DataSet
Dim tempdate As String
QueryString = "select * from autoOnOff where equNum=" & Trim(trans.TransmitID)
ds = search.query(QueryString)
If ds.Tables(0).Rows.Count > 0 Then
'''星期一
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D1start1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D1start1"))
trans.Monday(0) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D1end1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D1end1"))
trans.Monday(1) = tempdate
End If
'''星期二
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D2start1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D2start1"))
trans.Tuesday(0) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D2end1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D2end1"))
trans.Tuesday(1) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D2start2")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D2start2"))
trans.Tuesday(2) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D2end2")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D2end2"))
trans.Tuesday(3) = tempdate
End If
'''星期三
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D3start1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D3start1"))
trans.Wednesday(0) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D3end1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D3end1"))
trans.Wednesday(1) = tempdate
End If
'''星期四
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D4start1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D4start1"))
trans.Thursday(0) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D4end1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D4end1"))
trans.Thursday(1) = tempdate
End If
'''星期五
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D5start1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D5start1"))
trans.Friday(0) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D5end1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D5end1"))
trans.Friday(1) = tempdate
End If
'''星期六
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D6start1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D6start1"))
trans.Saturday(0) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D6end1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D6end1"))
trans.Saturday(1) = tempdate
End If
'''星期日
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D7start1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D7start1"))
trans.Sunday(0) = tempdate
End If
If Not IsDBNull(ds.Tables(0).Rows(0).Item("D7end1")) Then
tempdate = Trim(ds.Tables(0).Rows(0).Item("D7end1"))
trans.Sunday(1) = tempdate
End If
End If
ds = Nothing
End Sub
''*****************************'加载每台发射机的报警门限表**************************Object
Public Shared Sub LoadLowOrHigh(ByVal trans As Object)
Dim QueryString As String
Dim ds As DataSet
Dim strTemp As String
Dim dTemp(2) As Double
trans.ParaLowOrHigh = New ParaLowOrHighCls
QueryString = "select * from tranUpDown where equNum=" & Trim(trans.TransmitID)
ds = search.query(QueryString)
If ds.Tables(0).Rows.Count > 0 Then
'*********************整机参数
'''''入射功率
If Not IsDBNull(ds.Tables(0).Rows(0).Item("tranPo")) Then
strTemp = ds.Tables(0).Rows(0).Item("tranPo")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.tranPo.Low = dTemp(0)
trans.ParaLowOrHigh.tranPo.High = dTemp(1)
trans.ParaLowOrHigh.tranPo.isUse = dTemp(2)
End If
'''''反射功率
If Not IsDBNull(ds.Tables(0).Rows(0).Item("tranPr")) Then
strTemp = ds.Tables(0).Rows(0).Item("tranPr")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.tranPr.Low = dTemp(0)
trans.ParaLowOrHigh.tranPr.High = dTemp(1)
trans.ParaLowOrHigh.tranPr.isUse = dTemp(2)
End If
'''''驻波比
If Not IsDBNull(ds.Tables(0).Rows(0).Item("tranVswr")) Then
strTemp = ds.Tables(0).Rows(0).Item("tranVswr")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.tranVswr.Low = dTemp(0)
trans.ParaLowOrHigh.tranVswr.High = dTemp(1)
trans.ParaLowOrHigh.tranVswr.isUse = dTemp(2)
End If
'''''总电流
If Not IsDBNull(ds.Tables(0).Rows(0).Item("tranCurrent")) Then
strTemp = ds.Tables(0).Rows(0).Item("tranCurrent")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.tranCurrent.Low = dTemp(0)
trans.ParaLowOrHigh.tranCurrent.High = dTemp(1)
trans.ParaLowOrHigh.tranCurrent.isUse = dTemp(2)
End If
'''''总电压
If Not IsDBNull(ds.Tables(0).Rows(0).Item("tranVoltage")) Then
strTemp = ds.Tables(0).Rows(0).Item("tranVoltage")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.tranVoltage.Low = dTemp(0)
trans.ParaLowOrHigh.tranVoltage.High = dTemp(1)
trans.ParaLowOrHigh.tranVoltage.isUse = dTemp(2)
End If
'''''平衡功率
If Not IsDBNull(ds.Tables(0).Rows(0).Item("tranBalancePo")) Then
strTemp = ds.Tables(0).Rows(0).Item("tranBalancePo")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.tranBalancePo.Low = dTemp(0)
trans.ParaLowOrHigh.tranBalancePo.High = dTemp(1)
trans.ParaLowOrHigh.tranBalancePo.isUse = dTemp(2)
End If
'''''整机温度
If Not IsDBNull(ds.Tables(0).Rows(0).Item("tranTemp")) Then
strTemp = ds.Tables(0).Rows(0).Item("tranTemp")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.tranTemp.Low = dTemp(0)
trans.ParaLowOrHigh.tranTemp.High = dTemp(1)
trans.ParaLowOrHigh.tranTemp.isUse = dTemp(2)
End If
'********************************攻放插件参数
'''''输出功率
If Not IsDBNull(ds.Tables(0).Rows(0).Item("unitPo")) Then
strTemp = ds.Tables(0).Rows(0).Item("unitPo")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.unitPo.Low = dTemp(0)
trans.ParaLowOrHigh.unitPo.High = dTemp(1)
trans.ParaLowOrHigh.unitPo.isUse = dTemp(2)
End If
'''''输入功率 单位:瓦
If Not IsDBNull(ds.Tables(0).Rows(0).Item("unitInPo")) Then
strTemp = ds.Tables(0).Rows(0).Item("unitInPo")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.unitInPo.Low = dTemp(0)
trans.ParaLowOrHigh.unitInPo.High = dTemp(1)
trans.ParaLowOrHigh.unitInPo.isUse = dTemp(2)
End If
'''''反射功率
If Not IsDBNull(ds.Tables(0).Rows(0).Item("unitInPo")) Then
strTemp = ds.Tables(0).Rows(0).Item("unitInPo")
dTemp = GetLowOrHigh(strTemp)
trans.ParaLowOrHigh.unitInPo.Low = dTemp(0)
trans.ParaLowOrHigh.unitInPo.High = dTemp(1)
trans.ParaLowOrHigh.unitInPo.isUse = dTemp(2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -