?? bocom.pas
字號(hào):
unit Bocom;
//***********************************************************
//本類(lèi)是根據(jù)Bocom大屏的矩陣服務(wù)器管理軟件編寫(xiě),用作開(kāi)發(fā)客戶(hù)端程序,因此本類(lèi)
//中封裝了跟服務(wù)器通訊的基本接口,如連接、斷開(kāi)連接、發(fā)送信息等指令接口,以及
//delaytime等參數(shù)接口,在此基礎(chǔ)上可以很容易完成應(yīng)用程序開(kāi)發(fā)。
//具體是用方法:
//1 調(diào)用Connection(Ip:string;Port:integer)過(guò)程進(jìn)行服務(wù)器連接 。
//2 設(shè)置返回信息等待時(shí)間delaytime,調(diào)用控制命令函數(shù),完成數(shù)據(jù)發(fā)送并返回信息。
//3 調(diào)用DisConnection過(guò)程斷開(kāi)與服務(wù)器的連接。
//**********************************************************
interface
uses
SysUtils, Forms, ScktComp,DateUtils, Dialogs,classes;
type
TBocom = class //自定義基類(lèi)
//------------------------------------------------------------------------------------------
private //內(nèi)部變量、函數(shù)和過(guò)程定義
CommandStr:string; //命令字符串
BackMessage:string; //控制命令反饋信息
client : Tclientsocket; //生成TclientSocket對(duì)象
function SendMessage:string ; //發(fā)送信息
procedure ReadMessage(Sender: TObject;Socket: TCustomWinSocket); //讀取信息事件
//-----------------------------------------------------------------------------------------
public //外部可見(jiàn)變量和函數(shù)定義
DelayTime:integer;// 接收信息延遲時(shí)間設(shè)置,在時(shí)間范圍內(nèi)接收信息,超出后跳出。
//*********************外部可調(diào)用過(guò)程********************************
//--//視頻信號(hào)控制---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function VideoShow(VideoShow_Source:string;VideoShow_Left:integer;VideoShow_Top:integer;VideoShow_Width:integer;VideoShow_Hight:integer;VideoShow_ID:integer):string;//開(kāi)視頻
function VideoSize(VideoSize_Source:string;VideoSize_Width:integer;VideoSize_Hight:integer):string;//調(diào)整大小
function VideoMove(VideoMove_Source:string;VideoMove_Left:integer;VideoMove_Top:integer):string;//移動(dòng)位置
function VideoClose(VideoClose_Source:string):string;//關(guān)閉視頻
function VideoTop(VideoTop_Source:string):string;//前置窗口
function VideoBright(VideoBright_Source:string;VideoBright_Value:integer):string;//調(diào)整亮度
function VideoContrast(VideoContrast_Source:string;VideoContrast_Value:integer):string;//調(diào)整對(duì)比度
function VideoHue(VideoHue_Source:string;VideoHue_Value:integer):string;//調(diào)整色度
function VideoFormatN(VideoFormatN_Source:string):string;//信號(hào)制式ntsc
function VideoFormatS(VideoFormatS_Source:string):string;//信號(hào)制式secam
function VideoFormatP(VideoFormatP_Source:string):string;//信號(hào)制式pal
//-----攝像機(jī)信號(hào)控制-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function CameraNear(CameraNear_Speed:integer;CameraNear_Num:integer):string;//攝像機(jī)拉近開(kāi)始
function CameraStopNear(CameraStopNear_Num:integer):string;//攝像機(jī)拉近結(jié)束
function CameraFar(CameraFar_Speed:integer;CameraFar_Num:integer):string;//攝像機(jī)拉遠(yuǎn)開(kāi)始
function CameraStopFar(CameraStopFar_Num:integer):string;//攝像機(jī)拉遠(yuǎn)結(jié)束
function CameraUp(CameraUp_Speed:integer;CameraUp_Num:integer):string;//攝像機(jī)上移開(kāi)始
function CameraStopUp(CameraStopUp_Num:integer):string;//攝像機(jī)上移結(jié)束
function CameraDown(CameraDown_Speed:integer;CameraDown_Num:integer):string;//攝像機(jī)下移開(kāi)始
function CameraStopDown(CameraStopDown_Num:integer):string;//攝像機(jī)下移結(jié)束
function CameraLeft(CameraLeft_Speed:integer;CameraLeft_Num:integer):string;//攝像機(jī)左移開(kāi)始
function CameraStopLeft(CameraStopLeft_Num:integer):string;//攝像機(jī)左移結(jié)束
function CameraRight(CameraRight_Speed:integer;CameraRight_Num:integer):string;//攝像機(jī)右移開(kāi)始
function CameraStopRight(CameraStopRight_Num:integer):string;//攝像機(jī)右移結(jié)束
function CameraFocusFar(CameraFocusFar_Speed:integer;CameraFocusFar_Num:integer):string;//調(diào)遠(yuǎn)焦距開(kāi)始
function CameraStopFocusFar(CameraStopFocusFar_Num:integer):string;//調(diào)遠(yuǎn)焦距結(jié)束
function CameraFocusNear(CameraFocusNear_Speed:integer;CameraFocusNear_Num:integer):string;//調(diào)近焦距開(kāi)始
function CameraStopFocusNear(CameraStopFocusNear_Num:integer):string;//調(diào)近焦距結(jié)束
//RGB信號(hào)控制---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function RGBShow(RGBShow_Source:string;RGBShow_Left:integer;RGBShow_Top:integer;RGBShow_Width:integer;RGBShow_Hight:integer;RGBShow_ID:integer):string;//開(kāi)RGB信號(hào)
function RGBMove(RGBMove_Source:string;RGBMove_Left:integer;RGBMove_Top:integer):string;//移動(dòng)位置
function RGBSize(RGBSize_Source:string;RGBSize_Width:integer;RGBSize_Hight:integer):string;//調(diào)整大小
function RGBTop(RGBTop_Source:string):string;//前置窗口
function RGBLeft(RGBLeft_Source:string):string;//信號(hào)源左移
function RGBRight(RGBRight_Source:string):string;//信號(hào)源右移
function RGBUp(RGBUp_Source:string):string;//信號(hào)源上移
function RGBDown(RGBDown_Source:string):string;//信號(hào)源下移
function RGBBrightUp(RGBBrightUp_Source:string):string;//調(diào)整亮度+
function RGBBrightDown(RGBBrightDown_Source:string):string;//調(diào)整亮度-
function RGBContrastUp(RGBContrastUp_Source:string):string;//調(diào)整對(duì)比度+
function RGBContrastDown(RGBContrastDown_Source:string):string;//調(diào)整對(duì)比度-
function RGBClose(RGBClose_Source:string):string;//關(guān)閉RGB信號(hào)
//NetPC控制-----------------------------------------------------------------------------------------------------------------------------------------------------------
function NetPcShow(NetPcShow_Source:string;NetPcShow_Left:integer;NetPcShow_Top:integer;NetPcShow_Width:integer;NetPcShow_Hight:integer;NetPcShow_IP:string):string;//開(kāi)NETPC
function NetPcMove(NetPcMove_Source:string;NetPcMove_Left:integer;NetPcMove_Top:integer):string;//移動(dòng)位置
function NetPcTop(NetPcTop_Source:string):string;//前置窗口
function NetPcSize(NetPcSize_Source:string;NetPcSize_Width:integer;NetPcSize_Hight:integer):string;//調(diào)整大小
function NetPcClose(NetPcClose_Source:string):string;//關(guān)NETPC
//其他控制---------------------------------------------------------------------------------------------------------------------------------------------------------------------
function MaxRGBShow(MaxRGBShow_Source:string;MaxRGBShow_Left:integer;MaxRGBShow_Top:integer;MaxRGBShow_Width:integer;MaxRGBShow_Hight:integer;MaxRGBShow_ID:integer;MaxRGBShow_RowCount:integer;MaxRGBShow_ColCount:integer):string;//開(kāi)RGB信號(hào)
function MaxRGBClose(MaxRGBClose_Source:string):string;//關(guān)閉RGB信號(hào)
function MaxVideoShow(MaxVideoShow_Source:string;MaxVideoShow_Left:integer;MaxVideoShow_Top:integer;MaxVideoShow_Width:integer;MaxVideoShow_Hight:integer;MaxVideoShow_ID:integer;MaxVideoShow_RowCount:integer;MaxVideoShow_ColCount:integer):string;//開(kāi)VIDEO信號(hào)
function MaxVideoClose(MaxVideoClose_Source:string):string;//關(guān)閉VIDEO信號(hào)
function ProjectorShow(ProjectorShow_Source:string;ProjectorShow_Left:integer;ProjectorShow_Top:integer;ProjectorShow_Width:integer;ProjectorShow_Hight:integer;ProjectorShow_ID:integer;ProjectorShow_RowCount:integer;ProjectorShow_ColCount:integer):string;//開(kāi)投影機(jī)信燈
function ProjectorClose(ProjectorClose_Source:string):string;//關(guān)閉投影機(jī)信燈
function Login(Login_UserID:string;Login_Password:string):string;//登記用戶(hù)
function ListCamera():string;//列出攝像機(jī)信號(hào)
function ListNetPc():string;//列出netpc信號(hào)
function ListRGB():string;//列出rgbpc信號(hào)
function ListScheme():string;//列出預(yù)案
function ListDirectChannel():string;//列出直接通信號(hào)
function ListLiveWnd():string;//列出當(dāng)前顯示窗
function Unlogin():string;//注銷(xiāo)用戶(hù)
{ //---------------------------------------
function MaxVideoToRGB1():string;//maxvideo switch RGB1
function MaxVideoToRGB2():string;//maxvideo switch RGB2
function MaxVideoToVideo():string;// maxvideo switch VIDEO
function MaxVideoOnAll():string;//maxvideo power onall
function MaxVideoOffAll():string;//maxvideo power Offall
//直接通道信號(hào)控制---------------------------------------------------------------------------------------------------------------------
function DChannelShow(DChannelShow_Source:string;DChannelShow_Left:integer;DChannelShow_Top:integer;DChannelShow_Width:integer;DChannelShow_Hight:integer;DChannelShow_ID:integer):string;//開(kāi)通道信號(hào)
function DChannelMove(DChannelMove_Source:string;DChannelMove_Left:integer;DChannelMove_Top:integer):string;//移動(dòng)位置
function DChannelTop(DChannelTop_Source:string):string;//前置窗口
function DChannelSize(DChannelSize_Source:string;DChannelSize_Left:integer;DChannelSize_Top:integer):string;//調(diào)整大小
function DChannelClose(DChannelClose_Source:string):string;//關(guān)通道信號(hào)
function DChannelN(DChannelN_Mode:string;DChannelN_Source:string):string;//信號(hào)制式ntsc
function DChannelS(DChannelS_Mode:string;DChannelS_Source:string):string;//信號(hào)制式secam
function DChannelP(DChannelP_Mode:string;DChannelP_Source:string):string;//信號(hào)制式pal
function DChannelBright(DChannelBright_Source:string;DChannelBright_Value:integer):string;//調(diào)整亮度
function DChannelContrast(DChannelContrast_Source:string;DChannelContrast_Value:integer):string;//調(diào)整對(duì)比度
function DChannelHue(DChannelHue_Source:string;DChannelHue_Value:integer):string;//調(diào)整色度
function DChannelChange(DChannelChange_Source:string;DChannelChange_Value:integer):string;//更改信號(hào)源
}
//*********************************************
constructor create;
procedure Connection(Ip:string;Port:integer);
procedure DisConnection;
end;
//*************************命令字符串常量*******************************
const
//-------------------------------------------------------------------------------
VideoShow_Cmd='ntvideo show';
VideoSize_Cmd='ntvideo size';
VideoMove_Cmd='ntvideo move';
VideoClose_Cmd='ntvideo close';
VideoTop_Cmd='gotop';
VideoBright_Cmd='ntvideo brightness';
VideoContrast_Cmd='ntvideo contrast';
VideoHue_Cmd='hue';
VideoFormatN_Cmd='ntvideo format ntsc';
VideoFormatS_Cmd='ntvideo format secam';
VideoFormatP_Cmd='ntvideo format pal';
//-------------------------------------------------------------------------------
CameraNear_Cmd='camera near';
CameraStopNear_Cmd='camera stopnear';
CameraFar_Cmd='camera far';
CameraStopFar_Cmd='camera stopfar';
CameraUp_Cmd='camera up';
CameraStopUp_Cmd='camera stopup';
CameraDown_Cmd='camera down';
CameraStopDown_Cmd='camera stopdown';
CameraLeft_Cmd='camera left';
CameraStopLeft_Cmd='camera stopleft';
CameraRight_Cmd='camera right';
CameraStopRight_Cmd='camera stopright ';
CameraFocusFar_Cmd='camera focus> ';
CameraStopFocusFar_Cmd='camera stopfocus>';
CameraFocusNear_Cmd='camera focus<';
CameraStopFocusNear_Cmd='camera stopfocus<';
RGBShow_Cmd='rgbpc show';
RGBMove_Cmd='rgbpc move';
RGBSize_Cmd='rgbpc size';
RGBTop_Cmd='gotop';
RGBLeft_Cmd='rgbpc left';
RGBRight_Cmd='rgbpc right';
RGBUp_Cmd='rgbpc up';
RGBDown_Cmd='rgbpc down';
RGBBrightUp_Cmd='rgbpc brightnessup';
RGBBrightDown_Cmd='rgbpc brightnessdown';
RGBContrastUp_Cmd='rgbpc contrastup';
RGBContrastDown_Cmd='rgbpc contrastdown';
RGBClose_Cmd='rgbpc close';
DChannelShow_Cmd='directchannel show';
DChannelMove_Cmd='directchannel move';
DChannelTop_Cmd='';
DChannelSize_Cmd='directchannel size';
DChannelClose_Cmd='directchannel close';
DChannelN_Cmd='directchannel format ntsc';
DChannelS_Cmd='directchannel format secam';
DChannelP_Cmd='directchannel format pal';
DChannelBright_Cmd='directchannel brightness';
DChannelContrast_Cmd='directchannel contrast';
DChannelHue_Cmd='directchannel hue';
DChannelChange_Cmd='directchannel source';
NetPcShow_Cmd='netpc show';
NetPcMove_Cmd='netpc move';
NetPcTop_Cmd='gotop';
NetPcSize_Cmd='netpc size';
NetPcClose_Cmd='netpc close';
Login_Cmd='manager login ';
ListCamera_Cmd='list camera';
ListNetPc_Cmd='list netpc';
ListRGB_Cmd='list rgbpc';
ListScheme_Cmd='list scheme';
ListDirectChannel_Cmd='list directchannel';
ListLiveWnd_Cmd='list livewnd';
Unlogin_Cmd='Manager unlogin';
MaxRGBShow_Cmd='maxrgbpc show';
MaxRGBClose_Cmd='maxrgbpc close';
MaxVideoShow_Cmd='maxvideo show';
MaxVideoClose_Cmd='maxvideo close';
ProjectorShow_Cmd='maxvideo show';
ProjectorClose_Cmd='maxvideo close';
MaxVideoToRGB1_Cmd='maxvideo switch RGB1';
MaxVideoToRGB2_Cmd='maxvideo switch RGB2';
MaxVideoToVideo_Cmd='maxvideo switch VIDEO';
MaxVideoOnAll_Cmd='maxvideo power onall';
MaxVideoOffAll_Cmd='maxvideo power offall';
implementation
constructor TBocom.create;
begin
client := tclientsocket.Create(client);
client.OnRead := readmessage;
end;
//--//視頻信號(hào)控制---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function TBocom.VideoShow(VideoShow_Source:string;VideoShow_Left:integer;VideoShow_Top:integer;VideoShow_Width:integer;VideoShow_Hight:integer;VideoShow_ID:integer):string; //開(kāi)視頻
begin
CommandStr:=VideoShow_Cmd+' '+VideoShow_Source+' '+inttostr(VideoShow_Left)+' '+inttostr(VideoShow_Top)+' '+inttostr(VideoShow_Width)+' '+inttostr(VideoShow_Hight)+' '+inttostr(VideoShow_ID)+' -1 -1' ;
result:=SendMessage;
end;
function TBocom.VideoSize(VideoSize_Source:string;VideoSize_Width:integer;VideoSize_Hight:integer):string; //調(diào)整大小
begin
CommandStr:=VideoSize_Cmd+' '+VideoSize_Source+' '+inttostr(VideoSize_Width)+' '+inttostr(VideoSize_Hight) ;
result:=SendMessage;
end;
function TBocom.VideoMove(VideoMove_Source:string;VideoMove_Left:integer;VideoMove_Top:integer):string; //移動(dòng)位置
begin
CommandStr:=VideoMove_Cmd+' '+VideoMove_Source+' '+inttostr(VideoMove_Left)+' '+inttostr(VideoMove_Top) ;
result:=SendMessage;
end;
function TBocom.VideoClose(VideoClose_Source:string):string; //關(guān)閉視頻
begin
CommandStr:=VideoClose_Cmd+' '+VideoClose_Source ;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -