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.

102 lines
3.5 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
  1. //----------------------------------------------------------------------------
  2. // Dr.Frucht Systems Ltd.
  3. // Copyright � 2000-2022. All Rights Reserved.
  4. // Version 1.0 11/19/2022
  5. // Last modification: 11/19/2022
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: mojoKernel.h
  9. // AUTHOR: gagua
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of mojoKernel.cpp
  13. //----------------------------------------------------------------------------
  14. //
  15. #ifndef __MOJO_KERNEL_H_INCL__
  16. #define __MOJO_KERNEL_H_INCL__
  17. #define LA_METRO 1
  18. #define NOTARGET_SESSION_CLOSE 300 //sec
  19. #include "../../components/base/basicThread.h"
  20. #include "../../components/base/basicSettingsProvider.h"
  21. #include "../../components/base/basicEventHeap.h"
  22. #include "../../components/object/objectSystemAnchor.h"
  23. #include "../../alg/lgs/detectorStructures.h"
  24. #include "../../alg/lgs/detector.h"
  25. #include "../../alg/lgs/mask.h"
  26. #include "../../alg/generic/md5.h"
  27. #include "../common/kernelPrototype.h"
  28. #define MAX_CYCLE_COUNTER_VALUE 0xFFFFFFFF;
  29. #define SLEEP_KERNEL_INTERVAL 10 // 10 millisecond
  30. #define TIME_SYNC_INTERVAL 900000 // 15 minute(s) in 1 millisecond units
  31. #define STATUS_OK_INTERVAL 2000 // 2 Sec in 1 millisecond units
  32. #define KNL_SETTINGS_DETECTOR_WIDTH "DETECTOR_WIDTH"
  33. #define KNL_SETTINGS_FILTER_KERNELS "ENABLED_LRF"
  34. #define KNL_SETTINGS_DETECTOR_SST "DETECTOR_SST"
  35. //#define KNL_SETTINGS_V_MOTOR_SETPOINT "VERTICAL_ENC_FREQ"
  36. #define MOJO_KERNEL_TAG_SITE_ID "SITE_ID"
  37. #define MOJO_KERNEL_TAG_SERVER_IDENTITY "IDENTITY"
  38. /**
  39. * LRF_Kernel class - manages communication between client
  40. * handlers and PRU cores bseide of Event management.
  41. *
  42. *
  43. * @author gagua
  44. */
  45. class mojoKernel: public kernelPrototype{
  46. private:
  47. basicEventHeap * m_pEventHeap;
  48. ShadowMask * m_pShadow;
  49. time_t m_tTimeTSeconds;
  50. DBC_SYS_LOAD_INFO m_sSysInfo;
  51. char m_sIdentity[128];
  52. uint32_t m_nInstanceID;
  53. uint32_t m_nServerID;
  54. uint32_t m_nServerNodeID;
  55. systemAnchor * m_pSystemAnchor;
  56. bool m_bDebugMode;
  57. bool m_bSessionStarted;
  58. uint32_t m_nNoAlarmCounter;
  59. #ifdef LA_METRO
  60. #endif
  61. void loadFilters();
  62. void unloadFilters();
  63. void validateFilters();
  64. void validateSession();
  65. basicMutex m_mSessionProtector;
  66. void startSession();
  67. void stopSession( bool forced = true );
  68. static mojoKernel * _instance;
  69. void handleVideo( VIDEO_SEGMENT_INFO *ptr );
  70. protected:
  71. virtual void m_fThreadProc( void );
  72. // Constructor
  73. explicit mojoKernel( config_setting_t *ptr );
  74. public:
  75. static mojoKernel * getInstance( config_setting_t *ptr = NULL );
  76. // Destructor
  77. virtual ~mojoKernel();
  78. virtual bool create();
  79. virtual void dispatchEvent( EVENT_CONTAINER *Evt );
  80. inline bool getDebugMode(){ return m_bDebugMode; };
  81. };
  82. #endif // __MOJJO_KERNEL_H_INCL__