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

📄 loaddata.vb

📁 广西百色247台电视发射机监控源代码.已经过实践
💻 VB
📖 第 1 页 / 共 3 页
字号:
                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 LoadTransmitGME()
        Dim QueryString As String
        Dim i As Integer
        Dim ds As DataSet
        QueryString = "select * from equipments where equNum=7 or equNum=6 or equNum=4 order by equNum desc" 'equType=3 and traType=1
        Try
            ds = search.query(QueryString)
            If ds.Tables(0).Rows.Count > 0 Then '''''动态数组  
                ReDim TransGME(ds.Tables(0).Rows.Count - 1)
                For i = 0 To ds.Tables(0).Rows.Count - 1
                    '''''''''''''''''''初始化设备信息
                    TransGME(i) = New TransmitGME
                    TransGME(i).TransmitID = ds.Tables(0).Rows(i).Item("equNum")                   '''设备编号
                    TransGME(i).TransmitName = ds.Tables(0).Rows(i).Item("equName")                '''设备名称
                    TransGME(i).TraType = ds.Tables(0).Rows(i).Item("equType")                     '''设备厂家类型
                    TransGME(i).TransmitPower = ds.Tables(0).Rows(i).Item("equPower")              '''功率类型
                    TransGME(i).TransmitModel = ds.Tables(0).Rows(i).Item("equModel")              '''设备型号
                    TransGME(i).TransmitAddr = ds.Tables(0).Rows(i).Item("equAddress")             '''设备地址
                    TransGME(i).TransmitType = ds.Tables(0).Rows(i).Item("traType")                '''发射机类型
                    TransGME(i).MainExciter = ds.Tables(0).Rows(i).Item("equMainExcType")          '''主激励器类型
                    TransGME(i).StandbyExciter = ds.Tables(0).Rows(i).Item("equStandbyExcType")    '''备激励器类型
                    TransGME(i).AmpCount = ds.Tables(0).Rows(i).Item("unitCount")                  '''功放插件个数
                    TransGME(i).Port = ds.Tables(0).Rows(i).Item("port")                           '''对应通讯串口号
                    TransGME(i).PortPara = ds.Tables(0).Rows(i).Item("portPara")                   '''通讯参数
                    TransGME(i).CommType = ds.Tables(0).Rows(i).Item("commType")                   '''通讯方式
                    TransGME(i).State = ds.Tables(0).Rows(i).Item("state")                         '''设备状态
                    ' LoadOpenClose(TransGME(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
    ''*****************************'加载N+1切换器基本信息******************************
    Public Shared Sub LoadEquNand1()
        Dim QueryString As String
        Dim i As Integer
        Dim ds As DataSet
        QueryString = "select * from equipments where equType=10 "
        Try
            ds = search.query(QueryString)
            If ds.Tables(0).Rows.Count > 0 Then '''''动态数组  
                ReDim Nand1(ds.Tables(0).Rows.Count - 1)
                For i = 0 To ds.Tables(0).Rows.Count - 1
                    '''''''''''''''''''初始化设备信息
                    Nand1(i) = New OtherEqu
                    Nand1(i).TransmitID = ds.Tables(0).Rows(i).Item("equNum")                   '''设备编号
                    Nand1(i).TransmitName = ds.Tables(0).Rows(i).Item("equName")                '''设备名称
                    Nand1(i).TraType = ds.Tables(0).Rows(i).Item("equType")                     '''设备厂家类型
                    Nand1(i).TransmitModel = ds.Tables(0).Rows(i).Item("equModel")              '''设备型号
                    Nand1(i).TransmitAddr = ds.Tables(0).Rows(i).Item("equAddress")             '''设备地址
                    Nand1(i).TransmitType = ds.Tables(0).Rows(i).Item("traType")                '''发射机类型
                    Nand1(i).MainExciter = ds.Tables(0).Rows(i).Item("equMainExcType")          '''主激励器类型
                    Nand1(i).StandbyExciter = ds.Tables(0).Rows(i).Item("equStandbyExcType")    '''备激励器类型
                    Nand1(i).AmpCount = ds.Tables(0).Rows(i).Item("unitCount")                  '''功放插件个数
                    Nand1(i).Port = ds.Tables(0).Rows(i).Item("port")                           '''对应通讯串口号
                    Nand1(i).PortPara = ds.Tables(0).Rows(i).Item("portPara")                   '''通讯参数
                    Nand1(i).CommType = ds.Tables(0).Rows(i).Item("commType")                   '''通讯方式
                    Nand1(i).State = ds.Tables(0).Rows(i).Item("state")                         '''设备状态
                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
    ''*****************************'加载其他设备基本信息******************************
    '创建采集器、信号源切换器、防非接收机、发电机(20个)
    Public Shared Sub LoadOtherDev()
        Dim QueryString As String
        Dim i As Integer
        Dim ds As DataSet
        QueryString = "select * from equipments where equNum=13" 'equType=6 Or equType = 7 Or equType = 8 Or equType = 9 " '
        Try
            ds = search.query(QueryString)
            If ds.Tables(0).Rows.Count > 0 Then '''''动态数组  
                ReDim OtherDev(ds.Tables(0).Rows.Count - 1)
                For i = 0 To ds.Tables(0).Rows.Count - 1
                    '''''''''''''''''''初始化设备信息
                    OtherDev(i) = New OtherEqu
                    OtherDev(i).TransmitID = ds.Tables(0).Rows(i).Item("equNum")                   '''设备编号
                    OtherDev(i).TransmitName = ds.Tables(0).Rows(i).Item("equName")                '''设备名称
                    OtherDev(i).TraType = ds.Tables(0).Rows(i).Item("equType")                     '''设备厂家类型
                    OtherDev(i).TransmitModel = ds.Tables(0).Rows(i).Item("equModel")              '''设备型号
                    OtherDev(i).TransmitAddr = ds.Tables(0).Rows(i).Item("equAddress")             '''设备地址
                    OtherDev(i).TransmitType = ds.Tables(0).Rows(i).Item("traType")                '''发射机类型
                    OtherDev(i).MainExciter = ds.Tables(0).Rows(i).Item("equMainExcType")          '''主激励器类型
                    OtherDev(i).StandbyExciter = ds.Tables(0).Rows(i).Item("equStandbyExcType")    '''备激励器类型
                    OtherDev(i).AmpCount = ds.Tables(0).Rows(i).Item("unitCount")                  '''功放插件个数
                    OtherDev(i).Port = ds.Tables(0).Rows(i).Item("port")                           '''对应通讯串口号
                    OtherDev(i).PortPara = ds.Tables(0).Rows(i).Item("portPara")                   '''通讯参数
                    OtherDev(i).CommType = ds.Tables(0).Rows(i).Item("commType")                   '''通讯方式
                    OtherDev(i).State = ds.Tables(0).Rows(i).Item("state")                         '''设备状态
                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 LoadSourceSwitch()
        Dim QueryString As String
        Dim i As Integer
        Dim ds As DataSet
        QueryString = "select * from equipments where equType=7 order by equNum asc"
        Try
            ds = search.query(QueryString)
            If ds.Tables(0).Rows.Count > 0 Then '''''动态数组  
                ReDim SourceSwitchDev(ds.Tables(0).Rows.Count - 1)
                For i = 0 To ds.Tables(0).Rows.Count - 1
                    SourceSwitchDev(i) = New OtherEqu
                    SourceSwitchDev(i).TransmitID = ds.Tables(0).Rows(i).Item("equNum")                   '''设备编号
                    SourceSwitchDev(i).TransmitName = ds.Tables(0).Rows(i).Item("equName")                '''设备名称
                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 LoadSysConfig()
        Dim QueryString As String
        Dim i, j As Integer
        Dim ds As DataSet
        Dim ResNum As Integer
        QueryString = "select * from systemConfig "
        Try
            ds = search.query(QueryString)
            If ds.Tables(0).Rows.Count > 0 Then
                seekCycle = ds.Tables(0).Rows(0).Item("seekCycle")           '''通讯平台寻检设备周期
                dbCycle = ds.Tables(0).Rows(0).Item("dbCycle")               '''数据库刷新时间
                dataSaveCycle = ds.Tables(0).Rows(0).Item("dataSaveCycle")   '''数据库保存间隔时间
                isAutoOff = ds.Tables(0).Rows(0).Item("isAutoOff")           '''是否自动开关机
                isN1 = ds.Tables(0).Rows(0).Item("isN1")                     '''是否启用N+1自动切换
                isSignal = ds.Tables(0).Rows(0).Item("isSignal")             '''是否启用信号源自动切换
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        End Try
    End Sub
    Public Shared Sub LoadAlarmConfig()
        Dim QueryString As String
        Dim i, j As Integer
        Dim ds As DataSet
        Dim ResNum As Integer
        QueryString = "select * from alarmPoint "
        Try
            ds = search.query(QueryString)
            If ds.Tables(0).Rows.Count > 0 Then
                powerPoint = Int(ds.Tables(0).Rows(0).Item("tranPowerPoint")) / 100     '''报警门限
                VswrPoint = Val(ds.Tables(0).Rows(0).Item("tranVswrPoint"))
                TempPoint = Val(ds.Tables(0).Rows(0).Item("tranTempPoint"))
                envTempPoint = Val(ds.Tables(0).Rows(0).Item("envTempPoint"))
                envHumPoint = Val(ds.Tables(0).Rows(0).Item("envHumPoint"))
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        End Try
    End Sub
    ''*****************************'加载发射机每日自动开机******************************
    Public Shared Sub LoadAutoOnOff()
        Dim QueryString As String
        Dim i, j As Integer
        Dim ds As DataSet
        Dim ResNum As Integer
        QueryString = "select * from autoOnOff "
        'Try
        ds = search.query(QueryString)
        If ds.Tables(0).Rows.Count > 0 Then
            ResNum = ds.Tables(0).Rows.Count
            ReDim OpenClose(14 * ResNum - 1)
            For j = 0 To ResNum - 1
                For i = 0 To 6
                    '''开机
                    If IsDBNull(ds.Tables(0).Rows(j).Item("startTime" & Trim(CStr(i + 1)))) Then
                    Else
                        OpenClose(14 * j + i * 2) = New OpenClose
                        OpenClose(14 * j + i * 2).TransmitID = ds.Tables(0).Rows(j).Item("equNum")
                        OpenClose(14 * j + i * 2).ControlType = 0
                        OpenClose(14 * j + i * 2).Week = 1
                        OpenClose(14 * j + i * 2).ControlTime = CDate(ds.Tables(0).Rows(j).Item("startTime" & Trim(CStr(i + 1))))
                        OpenClose(14 * j + i * 2).Control = False
                    End If
                    '''关机
                    If IsDBNull(ds.Tables(0).Rows(j).Item("endTime" & Trim(CStr(i + 1)))) Then
                    Else
                        OpenClose(14 * j + i * 2 + 1) = New OpenClose
                        OpenClose(14 * j + i * 2 + 1).TransmitID = ds.Tables(0).Rows(j).Item("equNum")
                        OpenClose(14 * j + i * 2 + 1).ControlType = 0
                        OpenClose(14 * j + i * 2 + 1).Week = 1
                        OpenClose(14 * j + i * 2 + 1).ControlTime = CDate(ds.Tables(0).Rows(j).Item("endTime" & Trim(CStr(i + 1))))
                        OpenClose(14 * j + i * 2 + 1).Control = False
                    End If
                Next
            Next
        Else
        End If
        'Catch ex As Exception
        '    MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        'End Try
    End Sub
    ''*****************************'加载远程主机控制指令******************************
    Public Shared Sub LoadControlCmd(ByVal equID As Integer)
        Dim QueryString As String
        Dim i As Integer
        Dim ds As DataSet
        Dim ResNum As Integer
        QueryString = "select * from controlCmd  where response=0 and hostAffirm=0 and equNum=" & Trim(equID)
        'Try
        ds = search.query(QueryString)
        If ds.Tables(0).Rows.Count > 0 Then
            ResNum = ds.Tables(0).Rows.Count - 1
            ReDim ControlCmd(ResNum)
            For i = 0 To ResNum
                ControlCmd(i) = New ControlCmd
                ControlCmd(i).ID = ds.Tables(0).Rows(i).Item("id")
                ControlCmd(i).TransmitID = ds.Tables(0).Rows(i).Item("equNum")
                ControlCmd(i).ControlType = ds.Tables(0).Rows(i).Item("controltype")
                ControlCmd(i).ControlResult = ds.Tables(0).Rows(i).Item("response")
            Next
        Else
        End If
        'Catch ex As Exception
        '    MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        'End Try
    End Sub
End Class

⌨️ 快捷键说明

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