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.

95 lines
3.1 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: auxlib.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of Auxlib.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __AUXILARITY__LIBRARY__
  15. #define __AUXILARITY__LIBRARY__
  16. #include "FileStructs.h"
  17. #define WM_SENSOR_SHOW ( WM_USER+345 ) // wParam - pSensor ptr, lParam - pSensor ptr
  18. #define WM_SENSOR_UPDATE ( WM_USER+347 ) // wParam - pSensor ptr, lParam - pSensor ptr
  19. #define WM_ENABLE_ZONE ( WM_USER+348 ) // wParam - pZone ptr, lParam - pZone ptr
  20. #define WM_ENABLE_SENSOR ( WM_USER+349 ) // wParam - pSensor ptr, lParam - nSensor ptr
  21. #define WM_ENABLE_DTRBIT ( WM_USER+350 ) // wParam - pSensor ptr, lParam - bit number
  22. #define WM_PRINT_FILE ( WM_USER+351 ) // wParam - pFileName, lParam - pFileName
  23. #define WM_SHOW_TROUBLE ( WM_USER+352 ) // wParam - pText, lParam - pText
  24. #define WM_AUTORIZATION ( WM_USER+353 ) // wParam - pText, lParam - SAUTORIZATION*
  25. #define WM_EVENT_CLICK ( WM_USER+354 ) // wParam - nothing, lParam - EVENT*
  26. #define WM_VIDEO_DBL_CLICK ( WM_USER+355 ) // wParam - nothing, lParam - nothing
  27. enum { MODE_HOST = 0, MODE_MOBILEMAP = 1, MODE_BACKUP = 2, MODE_BACKUP_ACTIVE = 3, MODE_STOP = 4 };
  28. struct SDPOINT
  29. {
  30. double x;
  31. double y;
  32. SDPOINT( double X, double Y ) { x = X; y = Y; }
  33. SDPOINT() { x = y = 0.0; }
  34. };
  35. struct SDRECT
  36. {
  37. double left;
  38. double top;
  39. double right;
  40. double bottom;
  41. SDRECT(){ left = top = right = bottom = 0.0; }
  42. SDRECT( double l, double t, double r, double b ){ left = l; top = t; right = r; bottom = b; }
  43. };
  44. struct SDSIZE
  45. {
  46. double cx;
  47. double cy;
  48. SDSIZE(){ cx = cy = 0.0; }
  49. SDSIZE( double CX, double CY ){ cx = CX; cy = CY; }
  50. };
  51. typedef SDPOINT* LPSDPOINT;
  52. typedef SDRECT* LPSDRECT;
  53. typedef SDSIZE* LPSDSIZE;
  54. double CalcViewRectAndScale( CRect& mapRect, CRect *pViewRect );
  55. CRect CalcDrawRect( CRect& viewRect, CSize& mapSize, SDPOINT& mapShift, double scale );
  56. CPoint CalcDrawPoint( CRect& viewRect, CSize& mapSize, SDPOINT& mapPoint, double scale );
  57. SDPOINT CalcMapPoint( CPoint& viewPoint, CSize& mapSize, SDPOINT& mapShift, double scale );
  58. SDPOINT CalcViewCenterShift( CRect& viewRect, CSize& mapSize, double scale );
  59. BOOL FindTag( FILE_TAG *pTag, int nTagCount, LPCTSTR pTagName, LPDWORD pFilePtr );
  60. class CPerformanceCounter
  61. {
  62. public:
  63. CPerformanceCounter() { ::QueryPerformanceFrequency( &m_PerformanceFriquency ); }
  64. ~CPerformanceCounter() {}
  65. public:
  66. void Begin() { ::QueryPerformanceCounter( &m_PerformanceCounter[0] ); }
  67. double End()
  68. {
  69. ::QueryPerformanceCounter( &m_PerformanceCounter[1] );
  70. return ((double)m_PerformanceCounter[1].QuadPart -
  71. (double)m_PerformanceCounter[0].QuadPart) /
  72. (double)m_PerformanceFriquency.QuadPart;
  73. }
  74. private:
  75. LARGE_INTEGER m_PerformanceFriquency;
  76. LARGE_INTEGER m_PerformanceCounter[2];
  77. };
  78. #endif