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.
95 lines
3.1 KiB
95 lines
3.1 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: auxlib.h
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of Auxlib.h
|
|
//----------------------------------------------------------------------------
|
|
#ifndef __AUXILARITY__LIBRARY__
|
|
#define __AUXILARITY__LIBRARY__
|
|
|
|
#include "FileStructs.h"
|
|
|
|
#define WM_SENSOR_SHOW ( WM_USER+345 ) // wParam - pSensor ptr, lParam - pSensor ptr
|
|
#define WM_SENSOR_UPDATE ( WM_USER+347 ) // wParam - pSensor ptr, lParam - pSensor ptr
|
|
|
|
#define WM_ENABLE_ZONE ( WM_USER+348 ) // wParam - pZone ptr, lParam - pZone ptr
|
|
#define WM_ENABLE_SENSOR ( WM_USER+349 ) // wParam - pSensor ptr, lParam - nSensor ptr
|
|
#define WM_ENABLE_DTRBIT ( WM_USER+350 ) // wParam - pSensor ptr, lParam - bit number
|
|
|
|
#define WM_PRINT_FILE ( WM_USER+351 ) // wParam - pFileName, lParam - pFileName
|
|
|
|
#define WM_SHOW_TROUBLE ( WM_USER+352 ) // wParam - pText, lParam - pText
|
|
|
|
#define WM_AUTORIZATION ( WM_USER+353 ) // wParam - pText, lParam - SAUTORIZATION*
|
|
|
|
#define WM_EVENT_CLICK ( WM_USER+354 ) // wParam - nothing, lParam - EVENT*
|
|
|
|
#define WM_VIDEO_DBL_CLICK ( WM_USER+355 ) // wParam - nothing, lParam - nothing
|
|
|
|
enum { MODE_HOST = 0, MODE_MOBILEMAP = 1, MODE_BACKUP = 2, MODE_BACKUP_ACTIVE = 3, MODE_STOP = 4 };
|
|
|
|
struct SDPOINT
|
|
{
|
|
double x;
|
|
double y;
|
|
SDPOINT( double X, double Y ) { x = X; y = Y; }
|
|
SDPOINT() { x = y = 0.0; }
|
|
};
|
|
|
|
struct SDRECT
|
|
{
|
|
double left;
|
|
double top;
|
|
double right;
|
|
double bottom;
|
|
SDRECT(){ left = top = right = bottom = 0.0; }
|
|
SDRECT( double l, double t, double r, double b ){ left = l; top = t; right = r; bottom = b; }
|
|
};
|
|
|
|
struct SDSIZE
|
|
{
|
|
double cx;
|
|
double cy;
|
|
SDSIZE(){ cx = cy = 0.0; }
|
|
SDSIZE( double CX, double CY ){ cx = CX; cy = CY; }
|
|
};
|
|
|
|
typedef SDPOINT* LPSDPOINT;
|
|
typedef SDRECT* LPSDRECT;
|
|
typedef SDSIZE* LPSDSIZE;
|
|
|
|
double CalcViewRectAndScale( CRect& mapRect, CRect *pViewRect );
|
|
CRect CalcDrawRect( CRect& viewRect, CSize& mapSize, SDPOINT& mapShift, double scale );
|
|
CPoint CalcDrawPoint( CRect& viewRect, CSize& mapSize, SDPOINT& mapPoint, double scale );
|
|
SDPOINT CalcMapPoint( CPoint& viewPoint, CSize& mapSize, SDPOINT& mapShift, double scale );
|
|
SDPOINT CalcViewCenterShift( CRect& viewRect, CSize& mapSize, double scale );
|
|
|
|
BOOL FindTag( FILE_TAG *pTag, int nTagCount, LPCTSTR pTagName, LPDWORD pFilePtr );
|
|
|
|
class CPerformanceCounter
|
|
{
|
|
public:
|
|
CPerformanceCounter() { ::QueryPerformanceFrequency( &m_PerformanceFriquency ); }
|
|
~CPerformanceCounter() {}
|
|
public:
|
|
void Begin() { ::QueryPerformanceCounter( &m_PerformanceCounter[0] ); }
|
|
double End()
|
|
{
|
|
::QueryPerformanceCounter( &m_PerformanceCounter[1] );
|
|
return ((double)m_PerformanceCounter[1].QuadPart -
|
|
(double)m_PerformanceCounter[0].QuadPart) /
|
|
(double)m_PerformanceFriquency.QuadPart;
|
|
}
|
|
private:
|
|
LARGE_INTEGER m_PerformanceFriquency;
|
|
LARGE_INTEGER m_PerformanceCounter[2];
|
|
};
|
|
|
|
#endif
|