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.

75 lines
1.4 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: Kernel.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of Kernel.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "BoardReceiver.h"
  16. #include "Kernel.h"
  17. #ifdef _DEBUG
  18. #undef THIS_FILE
  19. static char THIS_FILE[]=__FILE__;
  20. #define new DEBUG_NEW
  21. #endif
  22. CKernel::CKernel()
  23. {
  24. }
  25. CKernel::~CKernel()
  26. {
  27. Destroy();
  28. }
  29. BOOL CKernel::Create()
  30. {
  31. Destroy();
  32. if( !m_Tracker.Create( FALSE, &m_Camera, &m_Relay, &m_AutoReset ) )
  33. return FALSE;
  34. if( !m_Shadow.Create() )
  35. return FALSE;
  36. if( !m_Detector.Create( FALSE, &m_Tracker, &m_Shadow, 0, "init_m.ini" ) )
  37. return FALSE;
  38. if( !m_Calibrator.Create( "lt0.ini" ) )
  39. return FALSE;
  40. return TRUE;
  41. }
  42. void CKernel::Destroy()
  43. {
  44. m_Detector.Destroy();
  45. m_Tracker.Destroy();
  46. m_Shadow.Destroy();
  47. }
  48. void CKernel::Invalidate( BOOL bZero, BOOL bSun, INT nRange )
  49. {
  50. // calibrate range
  51. nRange = m_Calibrator.Calibrate( nRange );
  52. m_Tracker.Invalidate();
  53. m_Detector.Invalidate( bZero, bSun, nRange, TRUE );
  54. }
  55. void CKernel::Reset( BOOL bReset )
  56. {
  57. m_Tracker.Reset();
  58. m_Detector.Reset( bReset );
  59. }