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
102 lines
3.5 KiB
//----------------------------------------------------------------------------
|
|
// Dr.Frucht Systems Ltd.
|
|
// Copyright © 2000-2022. All Rights Reserved.
|
|
// Version 1.0 11/19/2022
|
|
// Last modification: 11/19/2022
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: mojoKernel.h
|
|
// AUTHOR: gagua
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of mojoKernel.cpp
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
|
|
#ifndef __MOJO_KERNEL_H_INCL__
|
|
#define __MOJO_KERNEL_H_INCL__
|
|
|
|
#define LA_METRO 1
|
|
|
|
#define NOTARGET_SESSION_CLOSE 300 //sec
|
|
|
|
#include "../../components/base/basicThread.h"
|
|
#include "../../components/base/basicSettingsProvider.h"
|
|
#include "../../components/base/basicEventHeap.h"
|
|
#include "../../components/object/objectSystemAnchor.h"
|
|
#include "../../alg/lgs/detectorStructures.h"
|
|
#include "../../alg/lgs/detector.h"
|
|
#include "../../alg/lgs/mask.h"
|
|
#include "../../alg/generic/md5.h"
|
|
|
|
#include "../common/kernelPrototype.h"
|
|
|
|
#define MAX_CYCLE_COUNTER_VALUE 0xFFFFFFFF;
|
|
#define SLEEP_KERNEL_INTERVAL 10 // 10 millisecond
|
|
#define TIME_SYNC_INTERVAL 900000 // 15 minute(s) in 1 millisecond units
|
|
#define STATUS_OK_INTERVAL 2000 // 2 Sec in 1 millisecond units
|
|
|
|
|
|
#define KNL_SETTINGS_DETECTOR_WIDTH "DETECTOR_WIDTH"
|
|
#define KNL_SETTINGS_FILTER_KERNELS "ENABLED_LRF"
|
|
#define KNL_SETTINGS_DETECTOR_SST "DETECTOR_SST"
|
|
//#define KNL_SETTINGS_V_MOTOR_SETPOINT "VERTICAL_ENC_FREQ"
|
|
|
|
#define MOJO_KERNEL_TAG_SITE_ID "SITE_ID"
|
|
#define MOJO_KERNEL_TAG_SERVER_IDENTITY "IDENTITY"
|
|
/**
|
|
* LRF_Kernel class - manages communication between client
|
|
* handlers and PRU cores bseide of Event management.
|
|
*
|
|
*
|
|
* @author gagua
|
|
*/
|
|
class mojoKernel: public kernelPrototype{
|
|
private:
|
|
basicEventHeap * m_pEventHeap;
|
|
ShadowMask * m_pShadow;
|
|
time_t m_tTimeTSeconds;
|
|
DBC_SYS_LOAD_INFO m_sSysInfo;
|
|
char m_sIdentity[128];
|
|
uint32_t m_nInstanceID;
|
|
uint32_t m_nServerID;
|
|
uint32_t m_nServerNodeID;
|
|
systemAnchor * m_pSystemAnchor;
|
|
|
|
|
|
bool m_bDebugMode;
|
|
bool m_bSessionStarted;
|
|
|
|
uint32_t m_nNoAlarmCounter;
|
|
|
|
#ifdef LA_METRO
|
|
|
|
#endif
|
|
void loadFilters();
|
|
void unloadFilters();
|
|
|
|
void validateFilters();
|
|
void validateSession();
|
|
|
|
basicMutex m_mSessionProtector;
|
|
void startSession();
|
|
void stopSession( bool forced = true );
|
|
|
|
static mojoKernel * _instance;
|
|
|
|
void handleVideo( VIDEO_SEGMENT_INFO *ptr );
|
|
|
|
protected:
|
|
virtual void m_fThreadProc( void );
|
|
// Constructor
|
|
explicit mojoKernel( config_setting_t *ptr );
|
|
public:
|
|
static mojoKernel * getInstance( config_setting_t *ptr = NULL );
|
|
// Destructor
|
|
virtual ~mojoKernel();
|
|
virtual bool create();
|
|
virtual void dispatchEvent( EVENT_CONTAINER *Evt );
|
|
inline bool getDebugMode(){ return m_bDebugMode; };
|
|
};
|
|
|
|
#endif // __MOJJO_KERNEL_H_INCL__
|