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.

58 lines
1.2 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. // SensorDopler.cpp: implementation of the CSensorDopler class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "SensorDopler.h"
  6. //////////////////////////////////////////////////////////////////////
  7. // Construction/Destruction
  8. //////////////////////////////////////////////////////////////////////
  9. CSensorDopler::CSensorDopler()
  10. {
  11. }
  12. CSensorDopler::~CSensorDopler()
  13. {
  14. }
  15. void CSensorDopler::ConnectToDevice( CDeviceDopler *pDevice )
  16. {
  17. m_pDevice = pDevice;
  18. pDevice->SetSensorDopler( this );
  19. }
  20. BOOL CSensorDopler::SetDoplerMask( CLgDeviceDopler::DOPLER_MASK_ARRAY* pMask )
  21. {
  22. DOPLEREVENT event;
  23. event.id = DOPLEREVENT::ET_MASK;
  24. event.mask = *pMask;
  25. ::GetLocalTime( &event.time );
  26. m_Queue.Push( event );
  27. return TRUE;
  28. }
  29. void CSensorDopler::CheckState()
  30. {
  31. DOPLEREVENT event;
  32. EVENT e;
  33. SYSTEMTIME st;
  34. __int64 time;
  35. while( m_Queue.Pop( event ) )
  36. {
  37. switch( event.id )
  38. {
  39. case DOPLEREVENT::ET_MASK:
  40. // log info
  41. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CSensorDopler::CheckState"), _T("received DOPLEREVENT::ET_MASK") );
  42. m_Mask = event.mask;
  43. break;
  44. }
  45. }
  46. }