?? mainpage.frm
字號:
iNext = 0
'
Case "NINESHOW" ' 9 畫面
Show9Windows
bswitch = 9
Num = 9
iNext = 0
'
Case "SIXTEENSHOW" ' 9 畫面
Show16Windows
bswitch = 16
Num = 16
iNext = 0
'
Case "SWITCHSHOW"
LargeWindow 1
Switch1.Interval = SwitchInterval * 1000
Switch1.Enabled = True
tbrShowControl.Buttons.Item(1).Enabled = False
tbrShowControl.Buttons.Item(2).Enabled = False
tbrShowControl.Buttons.Item(3).Enabled = False
tbrShowControl.Buttons.Item(4).Enabled = False
Case "STOPSWITCH"
If Switch1.Enabled = True Then
Switch1.Enabled = False
End If
Show16Windows
tbrShowControl.Buttons.Item(1).Enabled = True
tbrShowControl.Buttons.Item(2).Enabled = True
tbrShowControl.Buttons.Item(3).Enabled = True
tbrShowControl.Buttons.Item(4).Enabled = True
tbrShowControl.Buttons.Item(5).key = ""
Label3.Caption = ""
Case "PreviousPage"
If iNext = 0 Then
tbrShowControl.Buttons.Item(7).Enabled = False
End If
If bswitch = 1 Then
If iNext > 1 Then
iNext = iNext - 1
End If
If iNext < 0 Then
iNext = 0
End If
' Label5.Caption = "頁碼" & iNext
LargeWindow iNext
End If
If bswitch = 4 Then
For i = 0 To 3
' record
Cli_Stop stockhandle(i + iNext * 4)
Next i
iNext = iNext - 1
If iNext <= 0 Then
iNext = 3
End If
' Label5.Caption = "頁碼" & iNext
For i = 0 To 3
stockhandle(i + iNext * 4) = Cli_PlaySoft(PicVideo(i).hwnd, Channel(i + iNext * 4, 1), m_linktype, Channel(i + iNext * 4, 0), UserName, UserPassword, 1)
Next i
End If
Case "NextPage"
tbrShowControl.Buttons.Item(7).Enabled = True
If bswitch = 1 Then
iNext = iNext + 1
If iNext >= 16 Then
iNext = 1
End If
' Label5.Caption = "頁碼" & iNext
LargeWindow iNext
End If
If bswitch = 4 Then
For i = 0 To 3
' record
Cli_Stop stockhandle(i + iNext * 4)
Next i
gDelay 500
iNext = iNext + 1
If iNext > 3 Then
iNext = 0
End If
' Label5.Caption = "頁碼" & iNext
For i = 0 To 3
stockhandle(i + iNext * 4) = Cli_PlaySoft(PicVideo(i).hwnd, Channel(i + iNext * 4, 1), m_linktype, Channel(i + iNext * 4, 0), UserName, UserPassword, 1)
Next i
End If
End Select
End Sub
' 選擇單畫面顯示對象
Private Sub tbrShowControl_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
Dim i As Integer
For i = 1 To Max_Slots
If ButtonMenu.key = "V" & i Then
LargeWindow i
Exit For
End If
Next i
End Sub
' 放大指定窗體
Public Sub LargeWindow(ByVal iChNo As Integer)
Dim i As Integer
PicVideo(iChNo - 1).left = Shift_L
PicVideo(iChNo - 1).top = Shift_T
PicVideo(iChNo - 1).Width = L_W
PicVideo(iChNo - 1).Height = L_H
' If gStatusOfVideo(iChNo) = STATUS_VideoWrong Then
'如果是視頻出錯狀態,則加載最大化顯示出錯的JPG圖片
' PicTmp.Picture = LoadPicture(gGetAppPath & "Err.Jpg")
' PicVideo(iChNo - 1).PaintPicture PicTmp.Picture, 0, 0, PicVideo(iChNo - 1).ScaleWidth, PicVideo(iChNo - 1).ScaleHeight
' PicTmp.Picture = LoadPicture("")
' Else
' 視頻正常,則重新設定視頻顯示區域,即占滿調整后的圖片框區域
' Cli_SetVideoRect iChNo - 1, 0, 0, PicVideo(iChNo - 1).ScaleHeight + 2, PicVideo(iChNo - 1).ScaleWidth + 2
' gDelay DelayTime
'End If
PicVideo(iChNo - 1).ZOrder
bHaveLargeWindow = True
End Sub
' 顯示4畫面
Private Sub Show1Windows()
'Dim i As Integer
'For i = 1 To 4
SetPositionOfSlot 0, 0, 1 'i - 1, i - 1, 4
' gDelay 1200
'Next i
End Sub
' 顯示4畫面
Public Sub Show4Windows()
Dim i As Integer
For i = 1 To 4
SetPositionOfSlot i - 1, i - 1, 4
' gDelay 1200
Next i
End Sub
' 顯示9畫面
Public Sub Show9Windows()
Dim i As Integer
For i = 1 To 9
SetPositionOfSlot i - 1, i - 1, 9
'
Next i
End Sub
' 顯示16畫面
Public Sub Show16Windows()
Dim i As Integer
For i = 1 To 16
SetPositionOfSlot i - 1, i - 1, 16
' gDelay 100
Next i
End Sub
' 定位顯示指定窗體,編號從0開始,nStyle為1、4、9,16
Private Sub SetPositionOfSlot(ByVal nWhere As Integer, ByVal nSlotNo As Integer, ByVal nStyle As Integer)
Dim iC As Integer, iW As Integer, iH As Integer
If nStyle = 1 Then
iC = 1
ElseIf nStyle = 4 Then
iC = 2
ElseIf nStyle = 9 Then
iC = 3
Else
iC = 4
End If
iW = (L_W \ iC)
iH = (L_H \ iC)
PicVideo(nSlotNo).left = (nWhere Mod iC) * iW + Shift_L
PicVideo(nSlotNo).top = (nWhere \ iC) * iH + Shift_T
PicVideo(nSlotNo).Width = iW
PicVideo(nSlotNo).Height = iH
PicVideo(nSlotNo).ZOrder
' If nSlotNo < 64 Then
'If gStatusOfVideo(nSlotNo + 1) = STATUS_VideoWrong Then
' PicTmp.Picture = LoadPicture(gGetAppPath & "err.JPG")
' PicVideo(nSlotNo).PaintPicture PicTmp.Picture, 0, 0, PicVideo(nSlotNo).ScaleWidth, PicVideo(nSlotNo).ScaleHeight
' PicTmp.Picture = LoadPicture("")
' Else
' Cli_SetVideoRect nSlotNo, 0, 0, PicVideo(nSlotNo).ScaleHeight + 2, PicVideo(nSlotNo).ScaleWidth + 2
' End If
' End If
End Sub
Private Sub picVideo_DblClick(Index As Integer)
If flag10 = False Then
flag10 = True
LargeWindow Index + 1
Else
flag10 = False
If Num = 4 Then
Show4Windows
ElseIf Num = 9 Then
Show9Windows
Else
Show16Windows
End If
End If
End Sub
' 顯示狀態
Private Sub ShowStatusOfSlots()
Dim i As Integer
Dim iStatus As Integer
Dim sStatusFile As String
For i = 1 To 64
sStatusFile = gGetIniPath & "StatusOf" & i & ".Ini"
If Dir(sStatusFile) <> "" Then
'讀ini文件
iStatus = GetPrivateProfileInt("Setup", "Status", STATUS_VideoWrong, sStatusFile)
' 改變相應圖標
Select Case iStatus
Case STATUS_VideoWrong
If gStatusOfVideo(i) <> STATUS_VideoWrong Then
' PicTmp.Picture = LoadPicture(gGetAppPath & "Err.Jpg")
' PicVideo(i - 1).PaintPicture PicTmp.Picture, 0, 0, PicVideo(i - 1).ScaleWidth, PicVideo(i - 1).ScaleHeight
' PicTmp.Picture = LoadPicture("")
End If
Case STATUS_Watching
If gStatusOfVideo(i) = STATUS_VideoWrong Then
PicVideo(i - 1).Picture = LoadPicture("")
End If
Case STATUS_NormalRecording
If gStatusOfVideo(i) = STATUS_VideoWrong Then
PicVideo(i - 1).Picture = LoadPicture("")
End If
Case STATUS_WarningRecord
If gStatusOfVideo(i) = STATUS_VideoWrong Then
PicVideo(i - 1).Picture = LoadPicture("")
End If
End Select
gStatusOfVideo(i) = iStatus
' 刪除文件
Kill sStatusFile
End If
Next i
End Sub
' 根據音視頻通道數設置【單畫面顯示】按鈕的按鈕菜單項哪些可用
Private Sub InitButtonMenu()
Dim i As Integer
If gNumberOfSlots < Max_Slots Then
For i = Max_Slots To gNumberOfSlots + 1 Step -1
tbrShowControl.Buttons(1).ButtonMenus(i).Enabled = False
Next
End If
If gNumberOfSlots <= 1 Then
tbrShowControl.Buttons(2).Enabled = False
ElseIf gNumberOfSlots <= 4 Then
tbrShowControl.Buttons(3).Enabled = False
End If
End Sub
'遠程控制傳輸方面
Private Sub Winsockclient_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
Dim receivefile() As Byte
Dim i As Integer
Dim s As String
Dim ServerNum As String
Dim ChannelNum As String
Dim IniFileName As String
On Error Resume Next
ReDim receivefile(1 To bytesTotal) As Byte
Winsockclient.GetData receivefile, vbArray + vbByte '告訴Winsock控件收到的是字節數組類型的數據
If bytesTotal > 4 Then
Open gGetIniPath & "\temp.ini" For Binary As #1
For i = 0 To bytesTotal
Put #1, , receivefile(i)
Next i
Close #1
s = GetIni("temp.ini", "系統配置", "服務器號", "00")
IniFileName = gGetIniPath & "Server" & s & ".ini"
Open IniFileName For Binary As #1
For i = 0 To bytesTotal
Put #1, , receivefile(i)
Next i
Close #1
MsgBox "成功更新配置文件"
End If
If bytesTotal <= 4 Then
ServerNum = (receivefile(0) - 48) & (receivefile(1) - 28)
ChannelNum = (receivefile(2) - 48) & (receivefile(3) - 28)
End If
End Sub
Private Sub WinsockEvents_DataArrival(ByVal bytesTotal As Long)
Dim strEvents As String
Dim strArray() As String
Dim iChannelNum As Integer
Dim iAddress As String
WinsockEvents.GetData strEvents
' strEvents = "2004年07月07日 18:01:35$2$1$2$無$1 $串口報警"
strArray = Split(strEvents, "$")
If InStr(strEvents, "運動檢測") And iChannelStatus(strArray(1), strArray(5)) = 0 Then
GoTo a1
ElseIf InStr(strEvents, "視頻丟失") And iLostStatus(strArray(1), strArray(5)) = 0 Then
GoTo a1
ElseIf InStr(strEvents, "串口報警") And iBaojingStatus(strArray(1), strArray(2), strArray(3)) = 0 Then
GoTo a1
Else
Load frmEvents
frmEvents.ReadEvents App.Path + "\報警日志.txt", Now
fr
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -