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.
101 lines
2.9 KiB
101 lines
2.9 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: chebron.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW `
|
|
// ~~~~~~~~
|
|
// Source file of ctks576.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "chebron.h"
|
|
|
|
#ifdef EMBEDDED_CAMERA_HEBRON
|
|
|
|
#ifdef INCLUDE_WINDOWS_DEFINITIONS
|
|
#include "..\lglib\device\dhebron.cpp"
|
|
#endif
|
|
|
|
CCameraHebronPTZ::CCameraHebronPTZ()
|
|
{
|
|
m_pComm = NULL;
|
|
m_pCamera = NULL;
|
|
}
|
|
|
|
CCameraHebronPTZ::~CCameraHebronPTZ()
|
|
{
|
|
Destroy();
|
|
}
|
|
|
|
BOOL CCameraHebronPTZ::Create( CCamera *pCamera, CComm485* pComm, CComm485::PORTS nPort, LGS::PCAMERA_PARAMETERS pParameters, BOOL bSwitcher, SWITCHER_SETTINGS *pSwitcher )
|
|
{
|
|
// destroy old incarnation :)
|
|
Destroy();
|
|
|
|
m_pComm = pComm;
|
|
m_pCamera = pCamera;
|
|
m_bSwitcher = bSwitcher;
|
|
|
|
if( !m_pComm->Create( nPort, 19200L, 8, CComm485::_NOPARITY ) )
|
|
return FALSE;
|
|
|
|
if( !m_Protocol.Create( m_pComm ) )
|
|
return FALSE;
|
|
|
|
SetProtocol( &m_Protocol );
|
|
|
|
SetAddress( 0 );
|
|
|
|
if( m_bSwitcher )
|
|
{
|
|
//#ifdef LGS_MIRROR
|
|
// m_pTable[0] = 360 - LGS_MIRROR_ANGLE_OF_VIEW * 1 / 4;
|
|
// m_pTable[1] = 360 - LGS_MIRROR_ANGLE_OF_VIEW * 2 / 4;
|
|
// m_pTable[2] = 360 - LGS_MIRROR_ANGLE_OF_VIEW * 3 / 4;
|
|
//#else
|
|
m_pTable[0] = pSwitcher->pTable[0];
|
|
m_pTable[1] = pSwitcher->pTable[1];
|
|
m_pTable[2] = pSwitcher->pTable[2];
|
|
//#endif
|
|
}
|
|
|
|
return CmdInit();
|
|
}
|
|
|
|
void CCameraHebronPTZ::Destroy()
|
|
{
|
|
m_Protocol.Destroy();
|
|
|
|
if( m_pComm )
|
|
{
|
|
m_pComm->Destroy();
|
|
m_pComm = NULL;
|
|
}
|
|
}
|
|
|
|
BOOL CCameraHebronPTZ::CmdSetPTZ( PTZ_DEGREE dPan, PTZ_DEGREE dTilt, PTZ_PERCENT dZoom )
|
|
{
|
|
if( m_bSwitcher )
|
|
{
|
|
//#ifdef LGS_MIRROR
|
|
// if ( dPan > m_pTable[0] ) dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 1 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
// else if ( dPan > m_pTable[1] ) dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 2 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
// else if ( dPan > m_pTable[2] ) dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 3 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
// else dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 4 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
//#else
|
|
if ( dPan > m_pTable[2] ) dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 4 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
else if ( dPan > m_pTable[1] ) dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 3 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
else if ( dPan > m_pTable[0] ) dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 2 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
else dPan = 360 - (LGS_MIRROR_ANGLE_OF_VIEW * 1 / 4 - LGS_MIRROR_ANGLE_OF_VIEW / 8);
|
|
//#endif
|
|
}
|
|
|
|
return CLgDevicePTZHebron::CmdSetPTZ( dPan, dTilt, dZoom );
|
|
}
|
|
|
|
#endif // EMBEDDED_CAMERA_HEBRON
|
|
|