//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 08/10/2003 // PROJECT: // SUBSYSTEM: // FILE: ctks576.cpp // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Source file of ctks576.cpp //---------------------------------------------------------------------------- #include "stdafx.h" #include "ctks576.h" #ifdef EMBEDDED_CAMERA_JVC #include "..\lglib\comm\ptks576.cpp" #include "..\lglib\device\dtks576.cpp" CCameraJVCTKS576PTZ::CCameraJVCTKS576PTZ() { m_pComm = NULL; m_pCamera = NULL; } CCameraJVCTKS576PTZ::~CCameraJVCTKS576PTZ() { Destroy(); } BOOL CCameraJVCTKS576PTZ::Create( CCamera *pCamera, CComm485* pComm, CComm485::PORTS nPort, LGS::PCAMERA_PARAMETERS pParameters ) { // destroy old incarnation :) Destroy(); m_pComm = pComm; m_pCamera = pCamera; if( !m_pComm->Create( nPort, 9600L, 8, CComm485::_EVENPARITY ) ) return FALSE; if( !m_Protocol.Create( m_pComm ) ) return FALSE; SetProtocol( &m_Protocol ); SetAddress( 0 ); return CmdInit(); } void CCameraJVCTKS576PTZ::Destroy() { m_Protocol.Destroy(); if( m_pComm ) { m_pComm->Destroy(); m_pComm = NULL; } } /* void CCameraJVCTKS576PTZ::Invalidate( DWORD nSlowTimer, WORD nFastTimer, BOOL bFastTimeValid ) { if( bFastTimeValid ) { // update timeout if( m_lTimeout > 0 && m_dwLastTime != nFastTimer ) { m_lTimeout--; m_dwLastTime = nFastTimer; } // write command if( m_lTimeout <= 0 ) { if( m_bRead ) ReadProc( &m_Protocol, 0, TRUE ); m_bRead = WriteProc( &m_Protocol, &m_lTimeout ); m_lTimeout <<= 3; } // read reply if( m_bRead ) { BOOL bSuccess = ReadProc( &m_Protocol, 0, FALSE ); // if read successeful if( bSuccess ) m_lTimeout = 0; m_bRead = !bSuccess; } } else { // update timeout if( m_lTimeout > 0 && m_dwLastTime != nSlowTimer ) { m_lTimeout --; m_dwLastTime = nSlowTimer; } // write command if( m_lTimeout <= 0 ) { if( m_bRead ) ReadProc( &m_Protocol, 0, TRUE ); m_bRead = WriteProc( &m_Protocol, &m_lTimeout ); // at least one timeout should exist m_lTimeout = ( m_lTimeout + 18 ) / 18; } // read reply if( m_bRead ) { BOOL bSuccess = ReadProc( &m_Protocol, 0, FALSE ); // if read successeful if( bSuccess ) m_lTimeout = 0; m_bRead = !bSuccess; } } } */ #endif // EMBEDDED_CAMERA_JVC