Old fashion design for PC-104
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.
 
 
 
 
 

165 lines
4.5 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: Sensor.h
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Header file of Sensor.h
//----------------------------------------------------------------------------
// Sensor.h: interface for the CSensor class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SENSOR_H__9B1BD4F7_71EC_11D4_A1EF_0010B55CB330__INCLUDED_)
#define AFX_SENSOR_H__9B1BD4F7_71EC_11D4_A1EF_0010B55CB330__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Auxlib.h"
#include "Visual.h"
#include "EventQueue.h"
#include "VideoCamera.h" // Added by ClassView
#include "Transform.h" // Added by ClassView
#include "DirectInputSet.h" // Added by ClassView
#include "DirectOutputSet.h" // Added by ClassView
class CZone;
class CSensorArray;
struct PATROL;
class CPropertySensorWnd;
class CSensor :
public CVisual
{
public:
CSensor();
~CSensor();
public:
virtual BOOL Paint( CDC *pDC, CRect& viewRect, CSize& mapSize, SDPOINT& mapShift, double mapScale, BOOL bInverse, BOOL bBigSize, CRect *UpdateRect = NULL );
public:
void SetSensorArray( CSensorArray *pSensorArray );
void SetAddress( int iAddress ) { m_iAddress = iAddress; }
int GetAddress( ) { return m_iAddress; }
void SetArrayIndex( int nIndex ) { m_nIndex = nIndex; }
int GetArrayIndex( ) { return m_nIndex; }
void SetSocket( int nSocket ) { m_nSocket = nSocket; }
int GetSocket() { return m_nSocket; }
void SetZoneIndex( int nZone ) { m_nZone = nZone; }
int GetZoneIndex() { return m_nZone; }
void SetZone( CZone *pZone ) { m_pZone = pZone; }
CZone *GetZone() { return m_pZone; }
void SetPatrol( BOOL bPatrol ) { m_bPatrol = bPatrol; }
BOOL GetPatrol( void ) { return m_bPatrol; }
void SetImageCount( int nImageCount ) { m_nImageCount = nImageCount; }
int GetImageCount() { return m_nImageCount; }
virtual void SetState( int nState );
virtual void Enable( BOOL bEnable );
virtual void Reset();
virtual void CheckCommand();
virtual void SetSensorPropertyWnd( CPropertySensorWnd *pWnd );
virtual void UpdateSensorProperty();
// relation with camera for video capturing
CVideoCamera *GetVideoCamera() { return m_pVideoCamera; }
void SetVideoCamera( CVideoCamera *pCamera ) { m_pVideoCamera = pCamera; }
CTransform *GetTransform( int nIndex ) { return ( nIndex < 2 ) ? m_pTransform[nIndex] : NULL; }
// IMPOTENT: transform object automatically will be deleted in ~CSensor
void SetTransform( BOOL bRemoteCamera, double dPanShift, double *pTiltTable, CTransform *pTransformMaster, CTransform *pTransformSlave )
{
m_pTransform[0] = pTransformMaster;
m_pTransform[1] = pTransformSlave;
m_bRemoteCamera = bRemoteCamera;
m_dPanShift = dPanShift;
for( int i = 0; i < 10; i++ )
m_pTiltTable[i] = pTiltTable[i];
}
CDirectInputSet& GetCommandInputSet() { return m_CommandInputSet; }
CDirectOutputSet& GetEventOutputSet() { return m_EventOutputSet; }
BOOL GetWaveSound( LPCTSTR *pFile, int& maxCount );
protected:
virtual void OnCommand( INT nCommand, BOOL bOn );
void OnEvent( INT nCommand, BOOL bOn );
protected:
void RedrawSensor();
INT m_iAddress;
DWORD m_dwTime;
INT m_nIndex;
INT m_nSocket;
INT m_nZone;
CZone *m_pZone;
BOOL m_bPatrol;
CSensorArray *m_pSensorArray;
// for video capturing
CVideoCamera *m_pVideoCamera;
private:
BOOL m_bRemoteCamera;
double m_dPanShift;
double m_pTiltTable[10];
CTransform *m_pTransform[2];
public:
// for update transformation from calibration program
int m_nTemplateType;
int m_nTemplateIndex;
public:
INT GetAddressCCC() { return m_nAddressCCC; }
void SetAddressCCC( INT nAddress ) { m_nAddressCCC = nAddress; }
private:
INT m_nAddressCCC;
// for sound
public:
double GetRangeTilt( double dRange );
bool CameraTransform( BOOL nDevice, double angle, double range, double *pPan, double *pTilt, double *pZoom );
public:
CLgArray<CString>& GetCalibrationNameArray() { return m_arrCalibrationName; }
private:
CLgArray<CString> m_arrCalibrationName;
private:
CPropertySensorWnd *m_pPropertySensorWnd;
private:
CDirectInputSet m_CommandInputSet;
CDirectOutputSet m_EventOutputSet;
private:
INT m_nImageCount;
};
#endif