You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
196 lines
5.8 KiB
196 lines
5.8 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: LgNetMessagePTZ.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of LgNetMessagePTZ.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "..\Version.h"
|
|
#include "LgNetMessagePTZ.h"
|
|
|
|
// commands
|
|
BOOL CLgNetMessagePTZ::BuildCmdMovePan(BOOL bRight, CLgDevicePTZ::PTZ_PERCENT dSpeed)
|
|
{
|
|
CLgDevicePTZ::PTZ_PAN pan;
|
|
pan.bRight = bRight;
|
|
pan.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::CMD_MOVE_PAN, &pan, sizeof( pan ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdMoveTilt(BOOL bUp, CLgDevicePTZ::PTZ_PERCENT dSpeed)
|
|
{
|
|
CLgDevicePTZ::PTZ_TILT tilt;
|
|
tilt.bUp = bUp;
|
|
tilt.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::CMD_MOVE_TILT, &tilt, sizeof( tilt ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdMoveZoom(BOOL bTele, CLgDevicePTZ::PTZ_PERCENT dSpeed)
|
|
{
|
|
CLgDevicePTZ::PTZ_ZOOM zoom;
|
|
zoom.bTele = bTele;
|
|
zoom.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::CMD_MOVE_ZOOM, &zoom, sizeof( zoom ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdMoveFocus(BOOL bFar, CLgDevicePTZ::PTZ_PERCENT dSpeed)
|
|
{
|
|
CLgDevicePTZ::PTZ_FOCUS focus;
|
|
focus.bFar = bFar;
|
|
focus.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::CMD_MOVE_FOCUS, &focus, sizeof( focus ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdSetIris( CLgDevicePTZ::PTZ_PERCENT dIris )
|
|
{
|
|
return Build( CLgDevicePTZ::CMD_SET_IRIS, &dIris, sizeof( dIris ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdSetFocus( CLgDevicePTZ::PTZ_PERCENT dFocus )
|
|
{
|
|
return Build( CLgDevicePTZ::CMD_SET_FOCUS, &dFocus, sizeof( dFocus ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdGetFocus()
|
|
{
|
|
return Build( CLgDevicePTZ::CMD_GET_FOCUS );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdSetPTZ(CLgDevicePTZ::PTZ_DEGREE dPan, CLgDevicePTZ::PTZ_DEGREE dTilt, CLgDevicePTZ::PTZ_PERCENT dZoom)
|
|
{
|
|
CLgDevicePTZ::PTZ_POSITION position;
|
|
position.dPan = dPan;
|
|
position.dTilt = dTilt;
|
|
position.dZoom = dZoom;
|
|
return Build( CLgDevicePTZ::CMD_SET_PTZ, &position, sizeof( position ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdGetPTZ()
|
|
{
|
|
return Build( CLgDevicePTZ::CMD_GET_PTZ );
|
|
}
|
|
|
|
// events
|
|
BOOL CLgNetMessagePTZ::BuildEvtGetPTZ( CLgDevicePTZ::PTZ_DEGREE dPan, CLgDevicePTZ::PTZ_DEGREE dTilt, CLgDevicePTZ::PTZ_PERCENT dZoom )
|
|
{
|
|
CLgDevicePTZ::PTZ_POSITION position;
|
|
position.dPan = dPan;
|
|
position.dTilt = dTilt;
|
|
position.dZoom = dZoom;
|
|
return Build( CLgDevicePTZ::EVT_GET_PTZ, &position, sizeof( position ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtSetPTZ( CLgDevicePTZ::PTZ_DEGREE dPan, CLgDevicePTZ::PTZ_DEGREE dTilt, CLgDevicePTZ::PTZ_PERCENT dZoom )
|
|
{
|
|
CLgDevicePTZ::PTZ_POSITION position;
|
|
position.dPan = dPan;
|
|
position.dTilt = dTilt;
|
|
position.dZoom = dZoom;
|
|
return Build( CLgDevicePTZ::EVT_SET_PTZ, &position, sizeof( position ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtMoveTilt( BOOL bUp, CLgDevicePTZ::PTZ_PERCENT dSpeed )
|
|
{
|
|
CLgDevicePTZ::PTZ_TILT tilt;
|
|
tilt.bUp = bUp;
|
|
tilt.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::EVT_MOVE_TILT, &tilt, sizeof( tilt ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtMovePan( BOOL bRight, CLgDevicePTZ::PTZ_PERCENT dSpeed )
|
|
{
|
|
CLgDevicePTZ::PTZ_PAN pan;
|
|
pan.bRight = bRight;
|
|
pan.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::EVT_MOVE_PAN, &pan, sizeof( pan ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtMoveZoom( BOOL bTele, CLgDevicePTZ::PTZ_PERCENT dSpeed )
|
|
{
|
|
CLgDevicePTZ::PTZ_ZOOM zoom;
|
|
zoom.bTele = bTele;
|
|
zoom.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::EVT_MOVE_ZOOM, &zoom, sizeof( zoom ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtMoveFocus(BOOL bFar, CLgDevicePTZ::PTZ_PERCENT dSpeed)
|
|
{
|
|
CLgDevicePTZ::PTZ_FOCUS focus;
|
|
focus.bFar = bFar;
|
|
focus.dSpeed = dSpeed;
|
|
return Build( CLgDevicePTZ::EVT_MOVE_FOCUS, &focus, sizeof( focus ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtSetIris( CLgDevicePTZ::PTZ_PERCENT dIris )
|
|
{
|
|
return Build( CLgDevicePTZ::EVT_SET_IRIS, &dIris, sizeof( dIris ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtSetFocus( CLgDevicePTZ::PTZ_PERCENT dFocus )
|
|
{
|
|
return Build( CLgDevicePTZ::EVT_SET_FOCUS, &dFocus, sizeof( dFocus ) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtGetFocus( CLgDevicePTZ::PTZ_PERCENT dFocus )
|
|
{
|
|
return Build( CLgDevicePTZ::EVT_GET_FOCUS, &dFocus, sizeof( dFocus ) );
|
|
}
|
|
|
|
// data access
|
|
BOOL CLgNetMessagePTZ::GetPTZ( CLgDevicePTZ::PPTZ_POSITION pPTZ )
|
|
{
|
|
return CLgNetMessage::GetData( pPTZ, sizeof(CLgDevicePTZ::PTZ_POSITION) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::GetPan( CLgDevicePTZ::PPTZ_PAN pPan )
|
|
{
|
|
return CLgNetMessage::GetData( pPan, sizeof(CLgDevicePTZ::PTZ_PAN) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::GetTilt( CLgDevicePTZ::PPTZ_TILT pTilt )
|
|
{
|
|
return CLgNetMessage::GetData( pTilt, sizeof(CLgDevicePTZ::PTZ_TILT) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::GetZoom( CLgDevicePTZ::PPTZ_ZOOM pZoom )
|
|
{
|
|
return CLgNetMessage::GetData( pZoom, sizeof(CLgDevicePTZ::PTZ_ZOOM) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::GetIris( CLgDevicePTZ::PTZ_PERCENT *pIris )
|
|
{
|
|
return CLgNetMessage::GetData( pIris, sizeof(CLgDevicePTZ::PTZ_PERCENT) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::GetFocus( CLgDevicePTZ::PTZ_PERCENT *pFocus )
|
|
{
|
|
return CLgNetMessage::GetData( pFocus, sizeof(CLgDevicePTZ::PTZ_PERCENT) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::GetFocus( CLgDevicePTZ::PPTZ_FOCUS pFocus )
|
|
{
|
|
return CLgNetMessage::GetData( pFocus, sizeof(CLgDevicePTZ::PTZ_FOCUS) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildCmdWiper( BOOL bOn )
|
|
{
|
|
return Build( CLgDevicePTZ::CMD_WIPER, &bOn, sizeof(BOOL) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::BuildEvtWiper( BOOL bOn )
|
|
{
|
|
return Build( CLgDevicePTZ::EVT_WIPER, &bOn, sizeof(BOOL) );
|
|
}
|
|
|
|
BOOL CLgNetMessagePTZ::GetWiper( PBOOL pOn )
|
|
{
|
|
return CLgNetMessage::GetData( pOn, sizeof(BOOL) );
|
|
}
|
|
|