📄 bocom.pas
字号:
//其他控制---------------------------------------------------------------------------------------------------------------------------------------------------------------------
function TBocom.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; //开RGB信号
begin
CommandStr:=MaxRGBShow_Cmd+' '+MaxRGBShow_Source+' '+inttostr(MaxRGBShow_Left)+' '+inttostr(MaxRGBShow_Top)+' '+inttostr(MaxRGBShow_Width)+' '+inttostr(MaxRGBShow_Hight)+' '+inttostr(MaxRGBShow_ID)+' '+inttostr(MaxRGBShow_RowCount)+' '+ inttostr(MaxRGBShow_ColCount);
result:=SendMessage;
end;
function TBocom.MaxRGBClose(MaxRGBClose_Source:string):string; //关闭RGB信号
begin
CommandStr:=MaxRGBClose_Cmd+' '+MaxRGBClose_Source;
result:=SendMessage;
end;
// --------------------------------------------------------------------------------------------
function TBocom.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; //开VIDEO信号
begin
CommandStr:=MaxVideoShow_Cmd+' '+MaxVideoShow_Source+' '+inttostr(MaxVideoShow_Left)+' '+inttostr(MaxVideoShow_Top)+' '+inttostr(MaxVideoShow_Width)+' '+inttostr(MaxVideoShow_Hight)+' '+inttostr(MaxVideoShow_ID)+' '+inttostr(MaxVideoShow_RowCount)+' '+ inttostr(MaxVideoShow_ColCount);
result:=SendMessage;
end;
function TBocom.MaxVideoClose(MaxVideoClose_Source:string):string; //关闭VIDEO信号
begin
CommandStr:=MaxVideoClose_Cmd+' '+MaxVideoClose_Source;
result:=SendMessage;
end;
//---------------------------------------------------------------------------------------------------------------------------------------
function TBocom.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; //开投影机信灯
begin
CommandStr:=ProjectorShow_Cmd+' '+ProjectorShow_Source+' '+inttostr(ProjectorShow_Left)+' '+inttostr(ProjectorShow_Top)+' '+inttostr(ProjectorShow_Width)+' '+inttostr(ProjectorShow_Hight)+' '+inttostr(ProjectorShow_ID)+' '+inttostr(ProjectorShow_RowCount)+' '+ inttostr(ProjectorShow_ColCount);
result:=SendMessage;
end;
function TBocom.ProjectorClose(ProjectorClose_Source:string):string; //关闭投影机信灯
begin
CommandStr:=ProjectorClose_Cmd+' '+ProjectorClose_Source;
result:=SendMessage;
end;
//-----------------------------------------------------------------------------------------------------------------------------------
function TBocom.Login(Login_UserID:string;Login_Password:string):string; //登记用户
begin
CommandStr:=Login_Cmd+' '+Login_UserID+' '+Login_Password;
result:=SendMessage;
end;
function TBocom.ListCamera():string; //列出摄像机信号
begin
CommandStr:=ListCamera_Cmd;
result:=SendMessage;
end;
function TBocom.ListNetPc():string; //列出netpc信号
begin
CommandStr:=ListNetPc_Cmd;
result:=SendMessage;
end;
function TBocom.ListRGB():string; //列出rgbpc信号
begin
CommandStr:=ListRGB_Cmd;
result:=SendMessage;
end;
function TBocom.ListScheme():string; //列出预案
begin
CommandStr:=ListScheme_Cmd;
result:=SendMessage;
end;
function TBocom.ListDirectChannel():string; //列出直接通信号
begin
CommandStr:=ListDirectChannel_Cmd;
result:=SendMessage;
end;
function TBocom.ListLiveWnd():string; //列出当前显示窗
begin
CommandStr:=ListLiveWnd_Cmd;
result:=SendMessage;
end;
function TBocom.Unlogin():string; //注销用户
begin
CommandStr:=Unlogin_Cmd;
result:=SendMessage;
end;
{ ====================================================以下命令很少用到===========================================================
//直接通道信号控制---------------------------------------------------------------------------------------------------------------------
function TBocom.DChannelShow(DChannelShow_Source:string;DChannelShow_Left:integer;DChannelShow_Top:integer;DChannelShow_Width:integer;DChannelShow_Hight:integer;DChannelShow_ID:integer):string; //开通道信号
begin
CommandStr:=DChannelShow_Cmd+' '+DChannelShow_Source+' '+inttostr(DChannelShow_Left)+' '+inttostr(DChannelShow_Top)+' '+inttostr(DChannelShow_Width)+' '+inttostr(DChannelShow_Hight)+' '+inttostr(DChannelShow_ID)+' -1 -1' ;
result:=SendMessage;
end;
function TBocom.DChannelMove(DChannelMove_Source:string;DChannelMove_Left:integer;DChannelMove_Top:integer):string; //移动位置
begin
CommandStr:=DChannelMove_Cmd+' '+DChannelMove_Source+' '+inttostr(DChannelMove_Left)+' '+inttostr(DChannelMove_Top) ;
result:=SendMessage;
end;
function TBocom.DChannelTop(DChannelTop_Source:string):string; //前置窗口
begin
CommandStr:=DChannelTop_Cmd+' '+DChannelTop_Source;
result:=SendMessage;
end;
function TBocom.DChannelSize(DChannelSize_Source:string;DChannelSize_Left:integer;DChannelSize_Top:integer):string; //调整大小
begin
CommandStr:=DChannelSize_Cmd+' '+DChannelSize_Source+' '+inttostr(DChannelSize_Left)+' '+inttostr(DChannelSize_Top);
result:=SendMessage;
end;
function TBocom.DChannelClose(DChannelClose_Source:string):string; //关通道信号
begin
CommandStr:=DChannelClose_Cmd+' '+DChannelClose_Source;
result:=SendMessage;
end;
function TBocom.DChannelN(DChannelN_Mode:string;DChannelN_Source:string):string; //信号制式ntsc
begin
CommandStr:=DChannelN_Cmd+' '+DChannelN_Mode+' '+DChannelN_Source ;
result:=SendMessage;
end;
function TBocom.DChannelS(DChannelS_Mode:string;DChannelS_Source:string):string; //信号制式secam
begin
CommandStr:=DChannelS_Cmd+' '+DChannelS_Mode+' '+DChannelS_Source ;
end;
function TBocom.DChannelP(DChannelP_Mode:string;DChannelP_Source:string):string; //信号制式pal
begin
CommandStr:=DChannelP_Cmd+' '+DChannelP_Mode+' '+DChannelP_Source ;
result:=SendMessage;
end;
function TBocom.DChannelBright(DChannelBright_Source:string;DChannelBright_Value:integer):string; //调整亮度
begin
CommandStr:=DChannelBright_Cmd+' '+DChannelBright_Source+' '+inttostr(DChannelBright_Value) ;
result:=SendMessage;
end;
function TBocom.DChannelContrast(DChannelContrast_Source:string;DChannelContrast_Value:integer):string; //调整对比度
begin
CommandStr:=DChannelContrast_Cmd+' '+DChannelContrast_Source+' '+inttostr(DChannelContrast_Value) ;
result:=SendMessage;
end;
function TBocom.DChannelHue(DChannelHue_Source:string;DChannelHue_Value:integer):string; //调整色度
begin
CommandStr:=DChannelHue_Cmd+' '+DChannelHue_Source+' '+inttostr(DChannelHue_Value) ;
result:=SendMessage;
end;
function TBocom.DChannelChange(DChannelChange_Source:string;DChannelChange_Value:integer):string; //更改信号源
begin
CommandStr:=DChannelChange_Cmd+' '+DChannelChange_Source+' '+inttostr(DChannelChange_Value) ;
result:=SendMessage;
end;
//---------------------------------------------------------------------------------------------------------------
function TBocom.MaxVideoToRGB1():string; //maxvideo switch RGB1
begin
CommandStr:=MaxVideoToRGB1_Cmd;
result:=SendMessage;
end;
function TBocom.MaxVideoToRGB2():string; //maxvideo switch RGB2
begin
CommandStr:=MaxVideoToRGB2_Cmd;
result:=SendMessage;
end;
function TBocom.MaxVideoToVideo():string; // maxvideo switch VIDEO
begin
CommandStr:=MaxVideoToVideo_Cmd;
result:=SendMessage;
end;
function TBocom.MaxVideoOnAll():string; //maxvideo power onall
begin
CommandStr:=MaxVideoOnAll_Cmd;
result:=SendMessage;
end;
function TBocom.MaxVideoOffAll():string; //maxvideo power Offall
begin
CommandStr:=MaxVideoOffAll_Cmd;
result:=SendMessage;
end;
}
//***********************************打开连接***********************************
procedure TBocom.Connection(Ip:string;Port:integer);
begin
client.host:=Ip;
client.port:=Port;
client.open;
end;
//*****************************************************************************
//***********************************断开连接***********************************
procedure TBocom.DisConnection;
begin
client.close;
end;
//******************************************************************************
//***********************************发送数据***********************************
function TBocom.SendMessage:string;
var TimeFlag:boolean;
StartTime,StopTime:TdateTime;
begin
client.Socket.SendText(CommandStr+#13);
StartTime:=now();
TimeFlag:=True;
while TimeFlag do
begin
StopTime:=now();
if SecondsBetween(StartTime,StopTime)>DelayTime then
begin
TimeFlag:=false;
// showmessage('good luck!');
end;
application.ProcessMessages;
end;
result:=BackMessage;
CommandStr:=''; // 发送完成各命令清除
end;
//******************************************************************************
//***********************************读取返回值*********************************
procedure TBocom.ReadMessage(Sender: TObject;Socket: TCustomWinSocket);
begin
BackMessage:=copy(Socket.ReceiveText,4,20); //读取反馈信息
end;
//*****************************************************************************
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -