123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- #ifndef _WS_COMMON_INC_H_
- #define _WS_COMMON_INC_H_
- #include <map>
- namespace sys
- {
- const int MIN_SEND_INTERVAL = 1;
-
- struct _THREAD_CONFIG_
- {
- int SendInterval;
- void Clear()
- {
- SendInterval = 0;
- }
- _THREAD_CONFIG_()
- {
- Clear();
- }
- };
-
- struct sensor{
- double m_acc;
- double m_ang;
- double m_tri_acc[3];
- double m_tri_ang[3];
- uint8_t m_walking_step;
- uint8_t m_jump_count;
- double m_hang_time;
- double m_hang_height;
- sensor(): m_acc(0.0), m_ang(0.0),m_walking_step(0), m_jump_count(0),m_hang_time(0), m_hang_height(0)
- {
- m_tri_acc[0] = m_tri_acc[1] = m_tri_acc[2] = m_tri_ang[0] = m_tri_ang[1] = m_tri_ang[2] = 0.0;
- }
- };
-
- struct _BASE_CARD_: public sensor
- {
- int Type;
- int ID;
- double x;
- double y;
- double z;
- double down_time;
- double enter_area_time;
- double rec_time;
- double work_time;
- int map_id;
- int area_id;
- int dept_id;
- int stat;
- int running_stat;
- int biz_stat;
- double speed;
- double m_freq;
- _BASE_CARD_()
- {
- Type = 0;
- ID = 0;
- x = 0;
- y = 0;
- z = 0;
- down_time = 0;
- enter_area_time = 0;
- rec_time = 0;
- work_time = 0;
- map_id = 0;
- area_id = 0;
- dept_id = 0;
- stat = 0;
- running_stat = 0;
- biz_stat = 0;
- speed = 0.0;
- m_freq = 0.0;
- }
- };
-
- struct _CARD_POS_ : public _BASE_CARD_
- {
- std::map<int,std::tuple<int,int,int,double,uint64_t>> area_info;
- int landmark_id;
- int lm_direction;
- int landmark_dis;
- int level_id;
- int is_on_duty;
- int display;
- int battery_stat;
- int battery_val;
- void Clear()
- {
- landmark_id = 0;
- lm_direction = 0;
- landmark_dis = 0;
- level_id = 0;
- is_on_duty = 0;
- display = 1;
- battery_stat = 0;
- battery_val = 10;
- }
- _CARD_POS_()
- {
- Clear();
- }
- };
-
- struct _STAT_DEPT_ITEM_
- {
- int DeptID;
- std::map<int, int> Area;
- std::map<int, int> Dept;
- std::map<int, int> OcptLvl;
- int Sum;
- _STAT_DEPT_ITEM_()
- {
- DeptID = 0;
- Sum = 0;
- }
- };
- struct light_state{
- int m_group_id;
- int m_light_id;
- int m_light_state;
- std::string m_card_id;
- bool m_state_changed;
- light_state(): m_group_id(0), m_light_id(0), m_light_state(0), m_card_id(""), m_state_changed(false)
- {}
- light_state(const int& gid, const int& lid, const int& state, const std::string& cid,bool state_changed)
- : m_group_id(gid),
- m_light_id(lid),
- m_light_state(state),
- m_card_id(cid),
- m_state_changed(state_changed)
- {}
- };
-
- struct device_state{
- uint32_t m_id;
- uint8_t m_type;
- uint8_t m_state;
- uint64_t m_cur_time;
- device_state(uint32_t id, uint8_t type, uint8_t state, uint64_t ctime)
- : m_id(id)
- , m_type(type)
- , m_state(state)
- , m_cur_time(ctime)
- {}
- device_state()
- : m_id(0)
- , m_type(0)
- , m_state(0)
- , m_cur_time(0)
- {}
- };
- }
- #endif
|