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.
1118 lines
34 KiB
1118 lines
34 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 17/11/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: LgNetDeviceLGS.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of LgNetDeviceLGS.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "..\Version.h"
|
|
#include "LgNetDeviceLGS.h"
|
|
#include "LgNetSocketMD.h"
|
|
|
|
CLgNetDeviceLGS::CLgNetDeviceLGS()
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::CLgNetDeviceLGS" );
|
|
}
|
|
|
|
CLgNetDeviceLGS::~CLgNetDeviceLGS()
|
|
{
|
|
// nessesary to do it, because vtable will be cleared before
|
|
// parent's destructor will be called
|
|
CLgLinkSP<CLgNetSocketDevice,CLgNetSocket>::Unlink();
|
|
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::~CLgNetDeviceLGS" );
|
|
}
|
|
|
|
BOOL CLgNetDeviceLGS::Link( CLgLink<CLgNetObject,CLgNetObject,CLgNetObjectChild> *pLink )
|
|
{
|
|
if( !CLgNetDevice::Link( pLink ) )
|
|
return FALSE;
|
|
|
|
m_OutMsg.SetDistinationID( pLink->GetThis()->GetID() );
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL CLgNetDeviceLGS::DeviceProc( CLgNetSocket *pSocket, CProtocol *pProtocol )
|
|
{
|
|
BOOL bResult = FALSE;
|
|
__try
|
|
{
|
|
bResult = DeviceProc_( pSocket, pProtocol );
|
|
}
|
|
__except( EXCEPTION_EXECUTE_HANDLER )
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::DeviceProc"), _T("Exception 0x%08X"), _exception_code() );
|
|
}
|
|
return bResult;
|
|
}
|
|
|
|
BOOL CLgNetDeviceLGS::DeviceProc_( CLgNetSocket *pSocket, CProtocol *pProtocol )
|
|
{
|
|
// cast to related protocol
|
|
CProtocolLGS *pProtocolLGS = (CProtocolLGS*) pProtocol;
|
|
|
|
// check input command
|
|
if( CLgDevice::IsReadyForCmd() && CLgNetObject::PopMessage( m_InMsg ) )
|
|
{
|
|
m_OutMsg.SetDistinationID( m_InMsg.GetSenderID() );
|
|
m_OutMsg.SetSenderID( GetID() );
|
|
|
|
// depend on command
|
|
BYTE bCommand;
|
|
if( m_InMsg.GetCommand( &bCommand ) )
|
|
{
|
|
PTZ_POSITION pos;
|
|
PTZ_PAN pan;
|
|
PTZ_TILT tilt;
|
|
PTZ_ZOOM zoom;
|
|
PTZ_FOCUS moveFocus;
|
|
PTZ_PERCENT iris;
|
|
PTZ_PERCENT focus;
|
|
BYTE device;
|
|
LGS_GETFILE getfile;
|
|
LGS_PARAMETERS_EX parameters;
|
|
LGS_SERIAL_NUMBER serialnumber;
|
|
INT baudrate;
|
|
LGS::CAMERA_PARAMETERS cameraparameters;
|
|
LGS::RELAY_PARAMETERS relayparameters;
|
|
LGS::VOLTAGE_PARAMETERS voltageparameters;
|
|
LGS::WIDTH_TABLE widthtable;
|
|
LGS::ZOOM_TABLE zoomtable;
|
|
LGS::TILT_TABLE tilttable;
|
|
LGS::LRF_DISABLE lrfdisable;
|
|
LGS_HZ_ARRAY HzArray;
|
|
INT nDevice;
|
|
BOOL bRowIncluded;
|
|
LGS_CALIBRATION_TABLE cTable;
|
|
DOPLER dopler;
|
|
DOPLER_MASK_ARRAY dopler_mask;
|
|
#ifndef LGS_DISABLE_FILE_SYSTEM
|
|
LG_FS_PACKET_EX fspacket;
|
|
#endif
|
|
BOOL wiper;
|
|
switch( bCommand )
|
|
{
|
|
case CLgDevicePTZ::CMD_GET_PTZ:
|
|
if( IsSpyMode() ) OnEvtGetPTZ( 0, 0, 0 );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdGetPTZ();
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_SET_PTZ:
|
|
if( m_InMsg.GetPTZ( &pos ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtSetPTZ( pos.dPan, pos.dTilt, pos.dZoom );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdSetPTZ( pos.dPan, pos.dTilt, pos.dZoom );
|
|
}
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_MOVE_TILT:
|
|
if( m_InMsg.GetTilt( &tilt ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtMoveTilt( tilt.bUp, tilt.dSpeed );
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdMoveTilt( tilt.bUp, tilt.dSpeed );
|
|
}
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_MOVE_PAN:
|
|
if( m_InMsg.GetPan( &pan ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtMovePan( pan.bRight, pan.dSpeed );
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdMovePan( pan.bRight, pan.dSpeed );
|
|
}
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_MOVE_ZOOM:
|
|
if( m_InMsg.GetZoom( &zoom ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtMoveZoom( zoom.bTele, zoom.dSpeed );
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdMoveZoom( zoom.bTele, zoom.dSpeed );
|
|
}
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_MOVE_FOCUS:
|
|
if( m_InMsg.GetFocus( &moveFocus ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtMoveFocus( moveFocus.bFar, moveFocus.dSpeed );
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdMoveFocus( moveFocus.bFar, moveFocus.dSpeed );
|
|
}
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_SET_IRIS:
|
|
if( m_InMsg.GetIris( &iris ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtSetIris( iris );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdSetIris( iris );
|
|
}
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_SET_FOCUS:
|
|
if( m_InMsg.GetFocus( &focus ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtSetFocus( focus );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdSetFocus( focus );
|
|
}
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_GET_FOCUS:
|
|
if( IsSpyMode() ) OnEvtGetFocus( 0 );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdGetFocus();
|
|
}
|
|
break;
|
|
case CLgDevicePTZ::CMD_WIPER:
|
|
if( m_InMsg.GetWiper( &wiper ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtWiper( wiper );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdWiper( wiper );
|
|
}
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceDopler::CMD_SET_DOPLER:
|
|
if( m_InMsg.GetDopler( &dopler ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtSetDopler( dopler.bEnable, dopler.dPanStep, dopler.dwTimeout );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdSetDopler( dopler.bEnable, dopler.dPanStep, dopler.dwTimeout );
|
|
}
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceDopler::CMD_GET_DOPLER:
|
|
if( IsSpyMode() ) OnEvtGetDopler( 0, 0, 0 );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdGetDopler();
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceDopler::CMD_GET_DOPLER_MASK:
|
|
memset( &dopler_mask, 0, sizeof(dopler_mask) );
|
|
if( IsSpyMode() ) OnEvtGetDoplerMask( &dopler_mask );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdGetDoplerMask();
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceDopler::CMD_SET_DOPLER_MASK:
|
|
if( m_InMsg.GetDoplerMask( &dopler_mask ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtSetDoplerMask( &dopler_mask );
|
|
else
|
|
{
|
|
if( m_bCameraBusy ) m_CameraSink.PushMessage( m_InMsg );
|
|
else m_bCameraBusy = CmdSetDoplerMask( &dopler_mask );
|
|
}
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_RESET:
|
|
if( IsSpyMode() ) OnEvtReset();
|
|
else CmdReset();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_FULL_RESET:
|
|
if( IsSpyMode() ) OnEvtFullReset();
|
|
else CmdFullReset();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_QUIT:
|
|
if( IsSpyMode() ) OnEvtQuit();
|
|
else CmdQuit();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_RESTART:
|
|
if( IsSpyMode() ) OnEvtRestart();
|
|
else CmdRestart();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_BORDER:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_BORDER, _T("SPY MODE") );
|
|
else CmdBorder();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SEND_BOARDDATA:
|
|
if( m_InMsg.GetSendBoardDataDevice( &device ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SEND_BOARDDATA, _T("SPY MODE") );
|
|
else CmdSendBoardData( device );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_DETECTOR:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_DETECTOR, _T("SPY MODE") );
|
|
else CmdDetector();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GETFILE:
|
|
if( m_InMsg.GetGetFile( &getfile ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GETFILE, _T("SPY MODE") );
|
|
else CmdGetFile( getfile.pSrcFileName, getfile.pDstFileName );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_PARAMETERS:
|
|
if( m_InMsg.GetCmdGetParameters( &nDevice ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_PARAMETERS, _T("SPY MODE") );
|
|
else CmdGetParameters( nDevice );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_PARAMETERS:
|
|
if( m_InMsg.GetCmdSetParameters( ¶meters ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_PARAMETERS, _T("SPY MODE") );
|
|
else CmdSetParameters( ¶meters );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_VOLTAGE_PARAMETERS:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_VOLTAGE_PARAMETERS, _T("SPY MODE") );
|
|
else CmdGetVoltageParameters();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_VOLTAGE_PARAMETERS:
|
|
if( m_InMsg.GetCmdSetVoltageParameters( &voltageparameters ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_VOLTAGE_PARAMETERS, _T("SPY MODE") );
|
|
else CmdSetVoltageParameters( &voltageparameters );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_LRF_DISABLE:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_LRF_DISABLE, _T("SPY MODE") );
|
|
else CmdGetLRFDisable();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_LRF_DISABLE:
|
|
if( m_InMsg.GetCmdSetLRFDisable( &lrfdisable ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_LRF_DISABLE, _T("SPY MODE") );
|
|
else CmdSetLRFDisable( &lrfdisable );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_SERIAL_NUMBER:
|
|
if( m_InMsg.GetGetSerialNumber( &serialnumber ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_SERIAL_NUMBER, _T("SPY MODE") );
|
|
else CmdGetSerialNumber( serialnumber.bAddress );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_SERIAL_NUMBER:
|
|
if( m_InMsg.GetSetSerialNumber( &serialnumber ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_SERIAL_NUMBER, _T("SPY MODE") );
|
|
else CmdSetSerialNumber( serialnumber.bAddress, serialnumber.pSerialNumber, serialnumber.bSize );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_ADDRESS:
|
|
if( m_InMsg.GetSetAddress( &serialnumber ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_ADDRESS, _T("SPY MODE") );
|
|
else CmdSetAddress( serialnumber.bAddress, serialnumber.pSerialNumber, serialnumber.bSize );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_FULL_BORDER:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_FULL_BORDER, _T("SPY MODE") );
|
|
else CmdFullBorder();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_COMM_BAUDRATE:
|
|
if( m_InMsg.GetBaudrate( &baudrate ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_COMM_BAUDRATE, _T("SPY MODE") );
|
|
else CmdSetCommBaudrate( baudrate );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_SOFTWARE_VERSION:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_SOFTWARE_VERSION, _T("SPY MODE") );
|
|
else CmdGetSoftwareVersion();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_CAMERA_PARAMETERS:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_CAMERA_PARAMETERS, _T("SPY MODE") );
|
|
else CmdGetCameraParameters();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_CAMERA_PARAMETERS:
|
|
if( m_InMsg.GetCameraParameters( &cameraparameters ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_CAMERA_PARAMETERS, _T("SPY MODE") );
|
|
else CmdSetCameraParameters( &cameraparameters );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_RELAY_PARAMETERS:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_RELAY_PARAMETERS, _T("SPY MODE") );
|
|
else CmdGetRelayParameters();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_RELAY_PARAMETERS:
|
|
if( m_InMsg.GetRelayParameters( &relayparameters ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_RELAY_PARAMETERS, _T("SPY MODE") );
|
|
else CmdSetRelayParameters( &relayparameters );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_HZ_DATA:
|
|
if( m_InMsg.GetCmdGetHzData( &bRowIncluded ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_HZ_DATA, _T("SPY MODE") );
|
|
else CmdGetHzData( bRowIncluded );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_HZ_DATA:
|
|
if( m_InMsg.GetCmdSetHzData( HzArray ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_HZ_DATA, _T("SPY MODE") );
|
|
else CmdSetHzData( HzArray );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_CALIBRATION_TABLE:
|
|
if( m_InMsg.GetCmdGetCalibrationTable( &nDevice ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_CALIBRATION_TABLE, _T("SPY MODE") );
|
|
else CmdGetCalibrationTable( nDevice );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_CALIBRATION_TABLE:
|
|
if( m_InMsg.GetCmdSetCalibrationTable( cTable ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_CALIBRATION_TABLE, _T("SPY MODE") );
|
|
else CmdSetCalibrationTable( cTable );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_WIDTH_TABLE:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_WIDTH_TABLE, _T("SPY MODE") );
|
|
else CmdGetWidthTable();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_WIDTH_TABLE:
|
|
if( m_InMsg.GetWidthTable( &widthtable ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_WIDTH_TABLE, _T("SPY MODE") );
|
|
else CmdSetWidthTable( &widthtable );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_ZOOM_TABLE:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_ZOOM_TABLE, _T("SPY MODE") );
|
|
else CmdGetZoomTable();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_ZOOM_TABLE:
|
|
if( m_InMsg.GetZoomTable( &zoomtable ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_ZOOM_TABLE, _T("SPY MODE") );
|
|
else CmdSetZoomTable( &zoomtable );
|
|
}
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_GET_TILT_TABLE:
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_GET_TILT_TABLE, _T("SPY MODE") );
|
|
else CmdGetTiltTable();
|
|
break;
|
|
|
|
case CLgDeviceLGS::CMD_SET_TILT_TABLE:
|
|
if( m_InMsg.GetTiltTable( &tilttable ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_SET_TILT_TABLE, _T("SPY MODE") );
|
|
else CmdSetTiltTable( &tilttable );
|
|
}
|
|
break;
|
|
|
|
#ifndef LGS_DISABLE_FILE_SYSTEM
|
|
case CLgDeviceLGS::CMD_FS_PACKET:
|
|
if( m_InMsg.GetFSPacket( &fspacket ) )
|
|
{
|
|
if( IsSpyMode() ) OnEvtCommandError( CLgDeviceLGS::CMD_FS_PACKET, _T("SPY MODE") );
|
|
else CmdFSCommand( &fspacket );
|
|
}
|
|
break;
|
|
#endif
|
|
|
|
default:
|
|
OnEvtCommandError( -1, _T("UNKNOWN COMMAND") );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
BOOL bWriteSuccess = TRUE;
|
|
LONG lReadTimeout = 100UL;
|
|
|
|
if( !IsSpyMode() )
|
|
bWriteSuccess = CLgDeviceLGS::WriteProc( pProtocolLGS, &lReadTimeout );
|
|
|
|
if( bWriteSuccess )
|
|
return CLgDeviceLGS::ReadProc( pProtocolLGS, lReadTimeout, TRUE );
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
BOOL CLgNetDeviceLGS::SetBaudrate( DWORD nBaudRate )
|
|
{
|
|
// protect link
|
|
CLgLocker Lock( &CLgLinkSP<CLgNetSocketDevice,CLgNetSocket>::GetLock() );
|
|
|
|
// if no socket it is an error!!!
|
|
CLgNetSocketMD *pSocket = static_cast<CLgNetSocketMD*>(CLgLinkSP<CLgNetSocketDevice,CLgNetSocket>::GetLinkThis());
|
|
if( !pSocket )
|
|
return FALSE;
|
|
|
|
return pSocket->SetBaudrate( nBaudRate );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtReset()
|
|
{
|
|
m_OutMsg.BuildEvtReset();
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFullReset()
|
|
{
|
|
m_OutMsg.BuildEvtFullReset();
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtQuit()
|
|
{
|
|
m_OutMsg.BuildEvtQuit();
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtRestart()
|
|
{
|
|
m_OutMsg.BuildEvtRestart();
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtBorder( CLgDeviceLGS::PLGS_BORDER pBorder )
|
|
{
|
|
m_OutMsg.BuildEvtBorder( pBorder );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtBorderProgress( BOOL bDownload, INT nProgress )
|
|
{
|
|
if( bDownload ) m_OutMsg.BuildEvtBorderProgress( nProgress );
|
|
else m_OutMsg.BuildEvtBorderPreparing( nProgress );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtTarget( BYTE bDevice, BYTE bType, double dAngle, double dRange, LONG nWidth )
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtTarget"), _T("LRF <%s>"), bDevice ? _T("SLAVE") : _T("MASTER") );
|
|
|
|
m_OutMsg.BuildEvtTarget( bDevice, bType, dAngle, dRange, nWidth );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFlip( INT nDevice, INT nLoops )
|
|
{
|
|
m_OutMsg.BuildEvtFlip( nDevice, nLoops );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtConnection( BOOL bConnected )
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtConnection"), _T("Connection %s"), bConnected ? _T("established") : _T("lost") );
|
|
|
|
m_OutMsg.BuildEvtConnection( bConnected );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtOperationMode( LGS_OPERATION_MODE eMode )
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtOperationMode") );
|
|
|
|
m_OutMsg.BuildEvtOperationMode( eMode );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtVoltage( BOOL bVoltageOk )
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtVoltage"), _T("Voltage %s"), bVoltageOk ? _T("normal") : _T("low") );
|
|
|
|
m_OutMsg.BuildEvtVoltage( bVoltageOk );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetVoltageParameters( LGS::PVOLTAGE_PARAMETERS pParameters )
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtGetVoltageParameters") );
|
|
|
|
m_OutMsg.BuildEvtGetVoltageParameters( pParameters );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetVoltageParameters( LGS::PVOLTAGE_PARAMETERS pParameters )
|
|
{
|
|
LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtSetVoltageParameters") );
|
|
|
|
m_OutMsg.BuildEvtSetVoltageParameters( pParameters );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtBlind( INT nDevice, BYTE bReason )
|
|
{
|
|
m_OutMsg.BuildEvtBlind( nDevice, bReason );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtError( LGS_ERROR_LEVEL eLevel, LGS_ERROR_ID eID, LPCTSTR pFormat, ... )
|
|
{
|
|
va_list marker;
|
|
va_start( marker, pFormat );
|
|
m_OutMsg.BuildEvtError( eLevel, eID, pFormat, marker );
|
|
va_end( marker );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetFile( BYTE bResult )
|
|
{
|
|
m_OutMsg.BuildEvtGetFileResult( bResult );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetFileProgress( INT nProgress )
|
|
{
|
|
m_OutMsg.BuildEvtGetFileProgress( nProgress );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetParameters( CLgDeviceLGS::PLGS_PARAMETERS_EX pParameters )
|
|
{
|
|
m_OutMsg.BuildEvtGetParameters( pParameters );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetParameters( CLgDeviceLGS::PLGS_PARAMETERS_EX pParameters )
|
|
{
|
|
m_OutMsg.BuildEvtSetParameters( pParameters );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetSerialNumber( BYTE bAddress, PBYTE pSerialNumber, BYTE bSize )
|
|
{
|
|
m_OutMsg.BuildEvtGetSerialNumber( bAddress, pSerialNumber, bSize );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetSerialNumber( BYTE bAddress, PBYTE pSerialNumber, BYTE bSize )
|
|
{
|
|
m_OutMsg.BuildEvtSetSerialNumber( bAddress, pSerialNumber, bSize );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetAddress( BYTE bAddress, PBYTE pSerialNumber, BYTE bSize )
|
|
{
|
|
m_OutMsg.BuildEvtSetAddress( bAddress, pSerialNumber, bSize );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFullBorder( CLgDeviceLGS::PLGS_FULL_BORDER pBorder )
|
|
{
|
|
m_OutMsg.BuildEvtFullBorder( pBorder );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFullBorderProgress( BOOL bDownload, INT nPercent )
|
|
{
|
|
if( bDownload ) m_OutMsg.BuildEvtFullBorderProgress( nPercent );
|
|
else m_OutMsg.BuildEvtFullBorderPreparing( nPercent );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetCommBaudrate( INT nBaudrate )
|
|
{
|
|
m_OutMsg.BuildEvtSetCommBaudrate( nBaudrate );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetSoftwareVersion( PBYTE pVersion, INT nCount )
|
|
{
|
|
m_OutMsg.BuildEvtGetSoftwareVersion( pVersion, nCount );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetPTZ( PTZ_DEGREE dPan, PTZ_DEGREE dTilt, PTZ_PERCENT dZoom )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtGetPTZ( dPan, dTilt, dZoom );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetPTZ( PTZ_DEGREE dPan, PTZ_DEGREE dTilt, PTZ_PERCENT dZoom )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtSetPTZ( dPan, dTilt, dZoom );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtMoveTilt( BOOL bUp, PTZ_PERCENT dSpeed )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtMoveTilt( bUp, dSpeed );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtMovePan( BOOL bRight, PTZ_PERCENT dSpeed )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtMovePan( bRight, dSpeed );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtMoveZoom( BOOL bTele, PTZ_PERCENT dSpeed )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtMoveZoom( bTele, dSpeed );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtMoveFocus( BOOL bFar, PTZ_PERCENT dSpeed )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtMoveFocus( bFar, dSpeed );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetIris( PTZ_PERCENT dIris )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtSetIris( dIris );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetFocus( PTZ_PERCENT dFocus )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtSetFocus( dFocus );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetFocus( PTZ_PERCENT dFocus )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtGetFocus( dFocus );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtWiper( BOOL bOn )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtWiper( bOn );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetDopler( BOOL bEnable, PTZ_DEGREE dPanStep, DWORD dwTimeout )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtSetDopler( bEnable, dPanStep, dwTimeout );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetDopler( BOOL bEnable, PTZ_DEGREE dPanStep, DWORD dwTimeout )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtGetDopler( bEnable, dPanStep, dwTimeout );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtDoplerAlarm( BOOL bAlarm, PTZ_DEGREE dPan )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtDoplerAlarm( bAlarm, dPan );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetDoplerMask( PDOPLER_MASK_ARRAY pMask )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtSetDoplerMask( pMask );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetDoplerMask( PDOPLER_MASK_ARRAY pMask )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
CLgNetMessagePTZ msg;
|
|
if( m_CameraSink.PopMessage(msg) )
|
|
PushMessage( msg );
|
|
|
|
m_OutMsg.BuildEvtGetDoplerMask( pMask );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtCommandError( INT nCommand, LPCTSTR pFormat, ... )
|
|
{
|
|
va_list marker;
|
|
va_start( marker, pFormat );
|
|
m_OutMsg.BuildEvtCommandError( nCommand, pFormat, marker );
|
|
va_end( marker );
|
|
CLgNetObject::SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtCameraError( INT nError )
|
|
{
|
|
m_bCameraBusy = FALSE;
|
|
|
|
m_OutMsg.BuildEvtCameraError( nError );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetCameraParameters( LGS::PCAMERA_PARAMETERS pParameters )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtGetCameraParameters", "(%d,%d,%d,%d)", pParameters->eType, pParameters->nShift, pParameters->bAuto, pParameters->nAutoDelay );
|
|
m_OutMsg.BuildEvtGetCameraParameters( pParameters );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetCameraParameters( LGS::PCAMERA_PARAMETERS pParameters )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtSetCameraParameters", "(%d,%d,%d,%d)", pParameters->eType, pParameters->nShift, pParameters->bAuto, pParameters->nAutoDelay );
|
|
m_OutMsg.BuildEvtSetCameraParameters( pParameters );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetRelayParameters( LGS::PRELAY_PARAMETERS pParameters )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtGetRelayParameters", "(%d,%d)", pParameters->bAuto, pParameters->nAutoDelay );
|
|
m_OutMsg.BuildEvtGetRelayParameters( pParameters );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetRelayParameters( LGS::PRELAY_PARAMETERS pParameters )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtSetRelayParameters", "(%d,%d)", pParameters->bAuto, pParameters->nAutoDelay );
|
|
m_OutMsg.BuildEvtSetRelayParameters( pParameters );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetWidthTable( LGS::PWIDTH_TABLE pTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, " CLgNetDeviceLGS::OnEvtGetWidthTable" );
|
|
m_OutMsg.BuildEvtGetWidthTable( pTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetWidthTable( LGS::PWIDTH_TABLE pTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, " CLgNetDeviceLGS::OnEvtSetWidthTable" );
|
|
m_OutMsg.BuildEvtSetWidthTable( pTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetZoomTable( LGS::PZOOM_TABLE pTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, " CLgNetDeviceLGS::OnEvtGetZoomTable" );
|
|
m_OutMsg.BuildEvtGetZoomTable( pTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetZoomTable( LGS::PZOOM_TABLE pTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, " CLgNetDeviceLGS::OnEvtSetZoomTable" );
|
|
m_OutMsg.BuildEvtSetZoomTable( pTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetTiltTable( LGS::PTILT_TABLE pTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, " CLgNetDeviceLGS::OnEvtGetTiltTable" );
|
|
m_OutMsg.BuildEvtGetTiltTable( pTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetTiltTable( LGS::PTILT_TABLE pTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, " CLgNetDeviceLGS::OnEvtSetTiltTable" );
|
|
m_OutMsg.BuildEvtSetTiltTable( pTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetHzDataProgress( INT nProgress )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtGetHzDataProgress"), _T("%d%%"), nProgress );
|
|
m_OutMsg.BuildEvtGetHzDataProgress( nProgress );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetHzData( LGS_HZ_ARRAY& HzArray )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtGetHzData") );
|
|
m_OutMsg.BuildEvtGetHzData( HzArray );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetHzDataProgress( INT nProgress )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtSetHzDataProgress"), _T("%d%%"), nProgress );
|
|
m_OutMsg.BuildEvtSetHzDataProgress( nProgress );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetHzData( LGS_HZ_ARRAY& HzArray )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtSetHzData") );
|
|
m_OutMsg.BuildEvtSetHzData( HzArray );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetCalibrationTable( LGS_CALIBRATION_TABLE& cTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtGetCalibrationTable") );
|
|
m_OutMsg.BuildEvtGetCalibrationTable( cTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetCalibrationTableProgress( INT nProgress )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtGetCalibrationTable"), _T("%d%%"), nProgress );
|
|
m_OutMsg.BuildEvtGetCalibrationTableProgress( nProgress );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetCalibrationTable( LGS_CALIBRATION_TABLE& cTable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtSetCalibrationTable"), _T("%s"), cTable.nDevice ? _T("Slave") : _T("Master") );
|
|
m_OutMsg.BuildEvtSetCalibrationTable( cTable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetCalibrationTableProgress( INT nProgress )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtSetCalibrationTableProgress"), _T("%d%%"), nProgress );
|
|
m_OutMsg.BuildEvtSetCalibrationTableProgress( nProgress );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtGetLRFDisable( LGS::PLRF_DISABLE pLRFDisable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtGetLRFDisable") );
|
|
m_OutMsg.BuildEvtGetLRFDisable( pLRFDisable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtSetLRFDisable( LGS::PLRF_DISABLE pLRFDisable )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtSetLRFDisable") );
|
|
m_OutMsg.BuildEvtSetLRFDisable( pLRFDisable );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtCommunicationError( INT nCount )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, _T("CLgNetDeviceLGS::OnEvtCommunicationError") );
|
|
m_OutMsg.BuildEvtCommunicationError( nCount );
|
|
SendMessageToParent( m_OutMsg );
|
|
}
|
|
|
|
// file system processing
|
|
#ifndef LGS_DISABLE_FILE_SYSTEM
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSCreateFile( LG_FS_RESULT bResult, DWORD dwHandle )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtFSCreateFile" );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSReadFile( LG_FS_RESULT bResult, BYTE nRead, PBYTE pBuffer )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtFSReadFile" );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSWriteFile( LG_FS_RESULT bResult, BYTE nWritten )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtFSWriteFile" );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSCloseFile( LG_FS_RESULT bResult )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtFSCloseFile" );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSFindFirst( LG_FS_RESULT bResult, DWORD dwHandle, PLG_FS_FIND_DATA pFindData )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtFSFindFirst", "%s %d %d", (bResult == LG_FS_RESULT_SUCCESS) ? pFindData->Name.pBuffer : "", pFindData->dwFileSizeLow, pFindData->dwFileAttributes );
|
|
if( bResult == LG_FS_RESULT_SUCCESS )
|
|
CmdFSFindNext( dwHandle );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSFindNext( LG_FS_RESULT bResult, PLG_FS_FIND_DATA pFindData )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtFSFindNext", "%s %d %d", (bResult == LG_FS_RESULT_SUCCESS) ? pFindData->Name.pBuffer : "", pFindData->dwFileSizeLow, pFindData->dwFileAttributes );
|
|
if( bResult == LG_FS_RESULT_SUCCESS )
|
|
CmdFSFindNext( 0 );
|
|
// else
|
|
// CmdFSFindFirst( "*.*" );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSFindClose( LG_FS_RESULT bResult )
|
|
{
|
|
LGLOG( LOG_LEVEL_HIGH, LOG_TYPE_INFO, this, "CLgNetDeviceLGS::OnEvtFSFindClose" );
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSCreateDirectory( LG_FS_RESULT bResult )
|
|
{
|
|
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSRemoveDirectory( LG_FS_RESULT bResult )
|
|
{
|
|
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSSetCurrentDirectory( LG_FS_RESULT bResult )
|
|
{
|
|
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSGetCurrentDirectory( LG_FS_RESULT bResult, PLG_FS_PATH pPath )
|
|
{
|
|
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSCopyFile( LG_FS_RESULT bResult )
|
|
{
|
|
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSMoveFile( LG_FS_RESULT bResult )
|
|
{
|
|
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSDeleteFile( LG_FS_RESULT bResult )
|
|
{
|
|
|
|
}
|
|
|
|
void CLgNetDeviceLGS::OnEvtFSUnsupported( PLG_FS_PACKET )
|
|
{
|
|
|
|
}
|
|
#endif
|