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.
104 lines
2.7 KiB
104 lines
2.7 KiB
//----------------------------------------------------------------------------
|
|
// Dr.Frucht Systems Ltd.
|
|
// Copyright © 2000-2016. All Rights Reserved.
|
|
// Version 2.0 3/30/2016
|
|
// Last modification: 3/30/2016
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: basicEvent.h
|
|
// AUTHOR: gagua
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of basicEvent.h
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
#ifndef __BASIC_EVENT_HEADER__
|
|
#define __BASIC_EVENT_HEADER__
|
|
|
|
#include <time.h>
|
|
#include <malloc.h>
|
|
#include <string.h>
|
|
#include <queue>
|
|
#include "basicTypes.h"
|
|
|
|
typedef enum E_basicEventTypeID {
|
|
EVT_NOINIT = 0,
|
|
EVT_READY = 1,
|
|
EVT_ALARM = 2,
|
|
EVT_COMMAND = 3,
|
|
EVT_KEY = 4,
|
|
EVT_JOYSTICK = 5,
|
|
EVT_STUDY = 6,
|
|
EVT_BUSY = 7,
|
|
EVT_FLIP = 8,
|
|
EVT_SCAN = 9,
|
|
EVT_TARGET = 10,
|
|
EVT_TARGET_WHITE = 11,
|
|
EVT_TARGET_BLACK = 12,
|
|
EVT_CAPTURE_START = 13,
|
|
EVT_CAPTURE_END = 14,
|
|
EVT_CAPTURE_DONE = 15,
|
|
EVT_ERROR = 255
|
|
} basicEventTypeID;
|
|
|
|
typedef enum E_basicEventClassID{
|
|
EVT_CLASS_SYSTEM = 0,
|
|
EVT_CLASS_SENSOR = 1,
|
|
EVT_CLASS_VIDEO = 2,
|
|
EVT_CLASS_IMAGE = 3
|
|
} basicEventClassID;
|
|
|
|
typedef struct S_basicEvent{
|
|
int m_nSourceUID;
|
|
int m_nDestinationUID;
|
|
basicEventClassID m_eClass;
|
|
basicEventTypeID m_eType;
|
|
struct tm sTS;
|
|
char *m_pHumanReadableMsg;
|
|
void *m_pEvtData;
|
|
} basicEvent;
|
|
/*
|
|
typedef struct S_alarmDataEvent{
|
|
uint32_t mRange;
|
|
uint32_t mSampleID;
|
|
uint32_t mStartID;
|
|
uint32_t mEndID;
|
|
uint16_t mCount;
|
|
uint32_t mWidth;
|
|
uint32_t mInfo;
|
|
} alarmDataEvent;
|
|
*/
|
|
#include "../../alg/generic/Transform.h"
|
|
typedef struct S_TARGET_DATA {
|
|
C3D_WGS84_LOC source_position;
|
|
C3D_SPH_DEGREES local_target;
|
|
C3D_DECART system_target;
|
|
C3D_WGS84_LOC global_target;
|
|
float area;
|
|
}TARGET_DATA;
|
|
|
|
typedef struct S_CLIENT_EVENT{
|
|
uint8_t type; //basicEventTypeID
|
|
uint32_t uts; //Time Stamp Seconds
|
|
uint16_t ums; //Time Stamp milliseconds
|
|
uint32_t th_id;
|
|
uint8_t k_id; // for Slave + 0x08
|
|
uint16_t range;
|
|
uint8_t w_cnt;
|
|
uint32_t a_th_node;
|
|
} CLIENT_EVENT;
|
|
|
|
typedef std::queue<CLIENT_EVENT*> EventsFIFO;
|
|
|
|
void utilizeBasicEvent( basicEvent &Evt );
|
|
void utilizeBasicEvent( basicEvent *Evt );
|
|
|
|
basicEvent *createBasicEvent(unsigned int SRC, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
|
|
basicEvent *createBasicTargetedEvent(unsigned int SRC, unsigned int DST, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
|
|
|
|
typedef std::queue< basicEvent > EventQueue;
|
|
typedef std::queue< basicEvent *> pEventQueue;
|
|
typedef std::vector< basicEvent > EventVector;
|
|
typedef std::vector< basicEvent *> pEventVector;
|
|
|
|
#endif
|