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.

146 lines
3.7 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: LgsRadar.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of LgsRadar.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __LGS__RADAR__H__INCLUDED__
  15. #define __LGS__RADAR__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "GenericWnd.h"
  20. #include "EventQueue.h"
  21. #include "Profile.h"
  22. #include "..\LgLib\LgImageDIB.h"
  23. #include "..\LgLib\Device\LgDeviceLGS.h"
  24. #include "LgMemoryDC.h"
  25. #include "LgsStateWnd.h"
  26. class CApplication;
  27. class CLgsRadarWnd :
  28. public CGenericWnd
  29. {
  30. public:
  31. CLgsRadarWnd();
  32. virtual ~CLgsRadarWnd();
  33. public:
  34. virtual BOOL Create( HWND, RECT rect, CApplication *pApplication, BOOL bDebugMode );
  35. public:
  36. void AddTarget( const TARGET_DESCRIPTION& td );
  37. void LoadBitmaps( CProfile *pProfile );
  38. BOOL StoreImage( LPCTSTR pPathName );
  39. void DrawFixedVideo( HDC hDC, RECT& rect, double scale );
  40. void DrawProgress( LPCTSTR pText, INT nSize, BOOL bHZ );
  41. void Reset();
  42. BOOL Show( BOOL bShow ) { return ShowWindow( bShow ? SW_SHOW : SW_HIDE ); }
  43. BOOL GetBitmap( CLgImageDIB *pDIB );
  44. void SetScale( INT n );
  45. void SetHzEditorMode( bool fEditor );
  46. void SetHzEnable( INT nType, BOOL bEnable );
  47. void SetHzEditType( INT nType ) { m_Type = nType; }
  48. CLgsStateWnd& GetIndicator() { return m_LgsStateWnd; }
  49. CLgDeviceLGS::LGS_HZ_ARRAY& GetHiddenZones( BOOL bTemp = FALSE ) { return bTemp ? m_TempHzArray : m_HzArray; }
  50. BOOL SetDoplerMask( CLgDeviceDopler::PDOPLER_MASK_ARRAY );
  51. protected:
  52. virtual LRESULT OnSize( WPARAM, LPARAM );
  53. virtual LRESULT OnPaint( WPARAM, LPARAM );
  54. virtual LRESULT OnMouseMove( WPARAM, LPARAM );
  55. virtual LRESULT OnLButtonDown( WPARAM, LPARAM );
  56. virtual LRESULT OnRButtonDown( WPARAM, LPARAM );
  57. virtual LRESULT OnDestroy( WPARAM, LPARAM );
  58. virtual LRESULT OnLgsSetHzData( WPARAM, LPARAM );
  59. virtual LRESULT OnLgsGetHzData( WPARAM, LPARAM );
  60. virtual LRESULT OnLgsHzDataProgress( WPARAM, LPARAM );
  61. virtual LRESULT OnLgsNotifyReset( WPARAM, LPARAM );
  62. virtual LRESULT OnLgsNotifyConnect( WPARAM, LPARAM );
  63. virtual LRESULT OnLgsNotifyCommandError( WPARAM, LPARAM );
  64. virtual LRESULT WindowProc( UINT, WPARAM, LPARAM );
  65. private:
  66. enum { PLANE_COUNT = 4, PLANE_WORK = 3 };
  67. CLgMemoryDC m_pDC[PLANE_COUNT];
  68. private:
  69. double m_Range;
  70. BOOL m_bDebugMode;
  71. BOOL m_bEditorMode;
  72. INT m_Scale;
  73. INT m_Type;
  74. HCURSOR m_hCursorNormal;
  75. HCURSOR m_hCursorEdit;
  76. HFONT m_hFont;
  77. private:
  78. void UpdatePlaneWork();
  79. private:
  80. void DrawDoplerMask( HDC hDC, RECT &rect );
  81. private:
  82. void UpdateLgsHz();
  83. void DrawPolygons( HDC hDC, RECT &rect );
  84. void OnHzEnable( INT nType, BOOL bOn );
  85. private:
  86. CLgsStateWnd m_LgsStateWnd;
  87. private:
  88. CLgMemoryDC m_pBaseDC[PLANE_COUNT];
  89. CLgCriticalSection m_LockWorkDC;
  90. private:
  91. static const double c_pScale[];
  92. private:
  93. CLgDeviceDopler::DOPLER_MASK_ARRAY m_DoplerMask;
  94. CLgDeviceDopler::DOPLER_MASK_ARRAY m_TempDoplerMask;
  95. private:
  96. BOOL m_bDoplerStartPoint;
  97. BOOL m_bDoplerInProgress;
  98. BOOL m_bChangedDopler;
  99. POINT m_DoplerStartPoint;
  100. double m_dDoplerStartAngle;
  101. private:
  102. CLgDeviceLGS::LGS_HZ_POLYGON m_TempHzPolygon;
  103. CLgDeviceLGS::LGS_HZ_ARRAY m_TempHzArray;
  104. CLgDeviceLGS::LGS_HZ_ARRAY m_HzArray;
  105. private:
  106. enum { MAX_HZ_TYPES = 5 };
  107. BOOL m_pPendingHzState[MAX_HZ_TYPES];
  108. BOOL m_bPendingHz;
  109. BOOL m_bPendingHzInProgress;
  110. BOOL m_bChangedHz;
  111. private:
  112. BOOL m_bSwitchSkip;
  113. private:
  114. CApplication *m_pApplication;
  115. };
  116. #endif