Browse Source

优化 告警的代码,及框架下业务上的代码

chensongchao 6 years ago
parent
commit
2c87ed9ec8

+ 1 - 3
Makefile.am

@@ -19,9 +19,7 @@ SRC_MAIN= ant.cpp area.cpp base64.cpp bindmorecard.cpp mine_business.cpp card_ar
 		  net-service.cpp point.cpp select_tool.cpp site_area.cpp special_area.cpp tdoa_sync.cpp visit.cpp \
 		  web-client.cpp worker.cpp event.cpp znet.cpp ya_setting.cpp area_business.cpp
 
-SRC_SYSTEM_BASIC= system_basic_info/SystemAnalysis.cpp
-
-AM_SOURCES=$(SRC_MONKEYCAR) $(SRC_MODULE_SERVICE) $(SRC_MAIN) $(SRC_MAIN_EVENT) $(SRC_SYSTEM_BASIC)
+AM_SOURCES=$(SRC_MONKEYCAR) $(SRC_MODULE_SERVICE) $(SRC_MAIN) $(SRC_MAIN_EVENT)
 
 AM_CPPFLAGS=-Wall -pthread -m64 -g -std=c++11  -I${prefix}/include -I/usr/local/mysql/include -Iwebsocket -Iwebsocket/sio -I./db -I../dist/include -I../rapidjson/include -Imodule_service
 

+ 2 - 11
ant.cpp

@@ -4,6 +4,7 @@
 #include "ant.h"
 #include "db_api/CDBSingletonDefine.h"
 #include "event.h"
+#include "tool_time.h"
 template<> std::shared_ptr<sit_list> 
 single_base<sit_list, int, std::shared_ptr<site>>::m_instance=std::make_shared<sit_list>();
 int site::index()const
@@ -343,17 +344,7 @@ void site::on_power_status(bool ac_down)//电源状态
         return;
     }
     m_power_ac_down=ac_down;
-    double limitVal = time(NULL);
-	if(m_power_ac_down )
-	{
-        //交流电 变成直流电(掉电),发送警告
-        event_tool::instance()->handle_event(OT_DEVICE_READER,ET_READER_POWER_BY_BATTERY,0,limitVal,ac_down,true);
-	}
-	else
-	{
-        //直流电 变成交流电,取消警告
-        event_tool::instance()->handle_event(OT_DEVICE_READER,ET_READER_POWER_BY_BATTERY,0,limitVal,ac_down,false);
-	}
+    event_tool::instance()->handle_event(OT_DEVICE_READER,ET_READER_POWER_BY_BATTERY,id(),tool_time::now_to_seconds(),ac_down,m_power_ac_down);
     log_info("[event warning: reader power supply by battery] reader_id: Power %d->%d.",id(),!m_power_ac_down,m_power_ac_down);
 }
 

+ 2 - 78
area.cpp

@@ -64,6 +64,8 @@ area::area(int id,int limit_count_person, int limit_time_person,double scale,int
      ,m_vehicle_count(0)
     {
 		m_area_business_list=area_business::get_instance_list(m_area_type);
+		m_event_person_count = false;
+		m_event_vehicle_count = false;
     }
 
 
@@ -351,17 +353,12 @@ void area_list::init_from_db(int id/*=-1*/)
         }
         else
         {
-            int tmp_old_area_type = 0;
             auto tmp_ptr = area_list::instance()->get(id);
             if(!tmp_ptr)
             {
 				tmp_ptr = create(area_type_id,area_id,over_count_person,over_time_person, scale,map_id,b_type);
                 area_list::instance()->add(id, tmp_ptr);
             }
-            else
-            {
-                tmp_old_area_type = tmp_ptr->m_area_type;
-            }
             tmp_ptr->update(over_count_person, over_time_person,scale,map_id,area_type_id, over_count_vehicle,over_time_vehicle);
             tmp_ptr->m_bound=init_path(path);
             tmp_ptr->m_over_speed_vehicle = over_speed_vehicle;
@@ -369,9 +366,6 @@ void area_list::init_from_db(int id/*=-1*/)
             for(const auto &p : tmp_ptr->m_bound)
                 log_info("point:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
 
-            // 检查原来的区域是否禁区
-            CheckAreaType(tmp_ptr,area_type_id,tmp_old_area_type);
-
             log_info("基础数据 增加或修改区域成功:区域id:%d,over_count_person:%d over_time_person:%d,scale:%.2f,map_id:%d\
                      ,area_type_id:%d,over_count_vehicle:%d,over_time_vehicle:%d",
                      id,over_count_person, over_time_person,scale,map_id,area_type_id,
@@ -387,76 +381,6 @@ void area_list::init_from_db(int id/*=-1*/)
     init_monkeycar_area(id);
 }
 
-//新画禁区功能-给禁区中的卡发送警告及呼叫
-void area_list::CheckAreaType(int area_id,int new_area_type,int old_area_type)
-{
-    auto area_ptr = area_list::instance()->get(area_id);
-    if (!area_ptr) {
-        log_info("区域已经删除:areaid=%d", area_id);
-        return;
-    }
-    CheckAreaType(area_ptr,new_area_type,old_area_type);
-}
-void area_list::CheckAreaType( std::shared_ptr<area> pArea,int new_area_type,int old_area_type)
-{
-    if (nullptr == pArea && new_area_type == old_area_type)
-    {
-        return ;
-    }
-    if (new_area_type != AREA_TYPE::AREA_TYPE_FORBIDDEN && old_area_type != AREA_TYPE::AREA_TYPE_FORBIDDEN)
-    {
-        return;
-    }
-
-    struct local_visit:visitor<std::shared_ptr<card_location_base>>
-    {
-        std::shared_ptr<area> m_area;
-        int m_old_area_type;
-        int m_new_area_type;
-        bool visit(std::shared_ptr<card_location_base> c)
-        {
-            //处理
-            point pt(c->x,c->y,c->z);
-            int sevid = 0;
-            bool inArea = false;
-            std::vector<std::shared_ptr<area>> point_areas = area_list::instance()->get_area(c->get_site_area()->get_site(),c, pt,sevid);
-            for(std::shared_ptr<area> & p : point_areas)
-            {
-                if (p->id() != m_area->id())
-                {
-                    continue;
-                }
-                inArea = true;
-                break;
-            }
-            //不在区域里
-            if (!inArea)
-            {
-                return true;
-            }
-            if (m_new_area_type == AREA_TYPE::AREA_TYPE_FORBIDDEN)
-            {
-                //发送进入禁区的警告
-                //呼叫
-                m_area->on_enter(c->get_area_hover(),c);
-            }
-            if (m_old_area_type == AREA_TYPE::AREA_TYPE_FORBIDDEN)
-            {
-                //之前是禁区,改成非禁区
-                //发送一个离开禁区的警告
-                //停止呼叫
-                m_area->on_leave(c->get_area_hover(),c);
-            }
-            return true;
-        }
-    };
-    local_visit lv;
-    lv.m_area = pArea;
-    lv.m_old_area_type = old_area_type;
-    lv.m_new_area_type = new_area_type;
-    card_list::instance()->accept(lv);
-}
-
 std::vector<point> area_list::init_path(std::string &str)
 {
 	if(str.empty())

+ 4 - 3
area.h

@@ -81,10 +81,14 @@ public:
 	//人卡超时及超员数量(阀值)
     int m_limit_person_second;
     int m_limit_person_count;
+    //是否人卡超员已有告警
+    bool m_event_person_count;
 
 	//人卡超时及超员数量(阀值)
     int m_limit_vehicle_second;
     int m_limit_vehicle_count;
+    //是否人卡超员已有告警
+    bool m_event_vehicle_count;
     double m_scale;
     int32_t m_mapid;
 
@@ -113,9 +117,6 @@ struct area_list:single_base<area_list,int,std::shared_ptr<area>>
     void init_monkeycar_area(int id=-1);
 private:
 	std::shared_ptr<area>  create(int type,int id,int limit_count_person, int limit_time_person,double scale,int32_t mapid,int32_t b_type);
-    //禁区功能-给禁区中的卡发送警告及呼叫
-    void CheckAreaType(int area_id,int new_area_type,int old_area_type);
-    void CheckAreaType( std::shared_ptr<area> pArea,int new_area_type,int old_area_type);
 };
 
 struct area_hover

+ 0 - 15
common_tool.h

@@ -83,21 +83,6 @@ public:
 		uint32_t cid = id & (~(type<<32));
 		return type_id_to_str(type,cid);
 	}
-    //是否系统网络字节顺序 true=大端(低位在前,高位在后) false=小端(高位在前,低位在后)
-    static bool IsBigEnd()
-    {
-        static int g_big = -1;
-        if (g_big == -1)
-        {
-            g_big = 1;
-            int x=0x12345678; /* 305419896 */
-            unsigned char *p=(unsigned char *)&x;
-            if (p[0] == 0x78) {
-                g_big = 0;
-            }
-        }
-        return g_big == 1;
-    }
 
 	static uint64_t card_id_to_u64(const std::string & cardid)
 	{

+ 0 - 25
message.cpp

@@ -2,31 +2,6 @@
 #include "zstream.h"
 #include "message.h"
 #include "log.h"
-void message_siteinfo::zero_this()
-{
-	memset(this,0,sizeof(*this));
-}
-
-void message_siteinfo::load(zistream&is,bool bAdhoc)
-{
-	zero_this();
-	is>>m_site_id>>m_time_stamp>>m_sec>>m_min>>m_hour>>m_day>>m_week>>m_mon;
-	is>>m_year>>m_site_relation;
-	if (bAdhoc)
-	{
-		uint16_t state = 0;
-		is>>state;
-		m_site_state = state;
-	}
-	else
-	{
-		uint8_t site_state = 0;
-		uint8_t powerType = 0;
-		is>>site_state>>powerType;
-		m_site_state = site_state;
-		m_site_power = powerType;
-	}
-}
 
 void message_locinfo::zero_this()
 {

+ 0 - 20
message.h

@@ -13,26 +13,6 @@ struct zistream;
 #define CHAR_ADHOC	0x803b							// 上传自组网数据
 #define CHAR_CTRL_READER_CMD 0x804c					// 向分站发送控制指令,控制分站向上位机发送数据
 
-// 分站上传上来的分站数据
-struct message_siteinfo
-{
-	uint32_t m_site_id;       //分站ID
-	uint16_t m_time_stamp;  //时间戳(0-65535)
-	uint8_t m_sec;
-	uint8_t m_min;
-	uint8_t m_hour;
-	uint8_t m_day;
-	uint8_t m_week;
-	uint8_t m_mon;
-	uint8_t m_year;
-	uint8_t m_site_relation;    //分站类型  -- 自组网数据=温度
-	int m_site_state;      //分站状态char
-	int m_site_power;      //分站电源类型
-	void zero_this();
-	void load(zistream&is,bool bAdhoc);
-};
-
-
 //	分站传上来的卡定位数据,包括tof,tdoa
 struct message_locinfo
 {

+ 19 - 10
module_service/area_business_count_checker.cpp

@@ -37,17 +37,15 @@ void area_business_count_checker::on_enter(const std::shared_ptr<area_hover>&a,
 	}
 	if(curVal > limitVal)
 	{
-		// 超员告警
-		/*std::string log = "";
-		for (uint64_t id : a->m_area->m_person_list)
+		if (c->is_vehicle())
 		{
-			log += tool_other::get_string_cardid(id);
-			log += "&";
+			a->m_area->m_event_vehicle_count = true;
 		}
-		//打印日志
-		log_info("[lemon mp_card_list_down_person:]:%s",log.c_str());
-		*/
-		event_tool::instance()->handle_event(a->m_area->is_mine()? OT_MINE : OT_AREA,ev,0,limitVal,curVal,true);
+		else
+		{
+			a->m_area->m_event_person_count = true;
+		}
+		event_tool::instance()->handle_event(a->m_area->is_mine()? OT_MINE : OT_AREA,ev,a->m_area->id(),limitVal,curVal,true);
 		log_info("area_business_count_checker::on_enter : Event OVER_COUNT=%d AreaId=%d,Limit=%d,CurNum=%d"
 		            ,ev,a->m_area->id(),limitVal,curVal);
 	}
@@ -70,12 +68,14 @@ void area_business_count_checker::on_leave(const std::shared_ptr<area_hover>&a,
     }
 	int limitVal = 0;
 	int curVal = 0;
+	bool tmp_event = false;
 	EVENT_TYPE ev = EVENT_TYPE::ET_OVER_COUNT_PERSON;
 	if (c->is_person())
 	{
 		a->m_area->m_person_count -- ;
 		limitVal = a->m_area->m_limit_person_count;
 		curVal = a->m_area->m_person_count;
+		tmp_event = a->m_area->m_event_person_count;
 		ev = a->m_area->is_mine()?EVENT_TYPE::ET_OVER_COUNT_PERSON : EVENT_TYPE::ET_AREA_OVER_COUNT_PERSON ;
 	}
 	else if (c->is_vehicle())
@@ -83,13 +83,22 @@ void area_business_count_checker::on_leave(const std::shared_ptr<area_hover>&a,
 		a->m_area->m_vehicle_count -- ;
 		limitVal = a->m_area->m_limit_vehicle_count;
 		curVal = a->m_area->m_vehicle_count;
+		tmp_event = a->m_area->m_event_vehicle_count;
 		ev = a->m_area->is_mine()?EVENT_TYPE::ET_OVER_COUNT_VEHICLE : EVENT_TYPE::ET_AREA_OVER_COUNT_VEHICLE ;
 	}
 	else{
 		return ;
 	}
-	if(curVal + 1 >= limitVal && curVal < limitVal)
+	if(tmp_event && curVal < limitVal)
 	{
+		if (c->is_vehicle())
+		{
+			a->m_area->m_event_vehicle_count = false;
+		}
+		else
+		{
+			a->m_area->m_event_person_count = false;
+		}
         log_info("area_business_count_checker::on_leave :Cancel Event OVER_COUNT=%d AreaId=%d,Limit=%d,CurNum=%d"
         ,ev,a->m_area->id(),limitVal,curVal);
 		event_tool::instance()->handle_event(a->m_area->is_mine()? OT_MINE : OT_AREA,ev,a->m_area->id(),limitVal,curVal,false);

+ 28 - 7
module_service/area_business_person_dwell_checker.cpp

@@ -11,13 +11,25 @@
 	人员&车辆的代码重用,请自行设计
 */
 
+struct SPersonDwellChecker : business_data
+{
+    uint64_t m_enter_time;
+    point m_enter_point;
+    SPersonDwellChecker()
+    {
+        m_enter_time = 0;
+    }
+};
 
 //进入区域,记录进入时间
 void area_business_person_dwell_checker::on_enter(const std::shared_ptr<area_hover>&a,
 							const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr)
 {
-	a->m_enter_point.set(c->x,c->y,c->z);
-	a->m_enter_time = tool_time::now_to_ms();
+
+    auto ptr_temp = std::make_shared<SPersonDwellChecker>();
+    ptr_temp->m_enter_point.set(c->x,c->y,c->z);
+    ptr_temp->m_enter_time = tool_time::now_to_ms();
+    ptr = ptr_temp;
 }
 
 
@@ -25,8 +37,13 @@ void area_business_person_dwell_checker::on_enter(const std::shared_ptr<area_hov
 void area_business_person_dwell_checker::on_hover(const std::shared_ptr<area_hover>&a,
 							const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
 {
+    auto ptr_temp = static_cast<SPersonDwellChecker*>(ptr.get());
+    if(nullptr == ptr_temp)
+    {
+        return ;
+    }
 	double limit_val = 0;
-	double cur_val = (tool_time::now_to_ms() - a->m_enter_time)/1000;
+	double cur_val = (tool_time::now_to_ms() - ptr_temp->m_enter_time)/1000;
 	EVENT_TYPE evType = EVENT_TYPE::ET_CARD_AREA_OVER_TIME_PERSON;
 	if(c->is_person())
     {
@@ -54,8 +71,13 @@ void area_business_person_dwell_checker::on_hover(const std::shared_ptr<area_hov
 void area_business_person_dwell_checker::on_leave(const std::shared_ptr<area_hover>&a,
 							const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
 {
-	a->m_enter_point.set(c->x,c->y,c->z);
-	a->m_enter_time = time(nullptr);
+    auto ptr_temp = static_cast<SPersonDwellChecker*>(ptr.get());
+    if(nullptr == ptr_temp)
+    {
+        return ;
+    }
+    ptr_temp->m_enter_point.set(c->x,c->y,c->z);
+    ptr_temp->m_enter_time = tool_time::now_to_ms();
     EVENT_TYPE evType = EVENT_TYPE::ET_CARD_AREA_OVER_TIME_PERSON;
     if(c->is_person())
     {
@@ -66,7 +88,6 @@ void area_business_person_dwell_checker::on_leave(const std::shared_ptr<area_hov
         return ;
     }
     uint64_t id = tool_other::type_id_to_u64(c->m_type, c->m_id);
-    event_tool::instance()->handle_event(OT_CARD,evType,id,0,0,true);
-
+    event_tool::instance()->handle_event(OT_CARD,evType,id,0,0,false);
 }
 

+ 0 - 5
system_basic_info/SystemAnalysis.cpp

@@ -1,5 +0,0 @@
-#include "SystemAnalysis.h"
-
-int LocationSystemCount[LOCATION_SYSTEM_BRANCH_MAX + 1] = {0};
-
-int TagLocationSystemFlag[TAG_LOCATION_BRANCH_MAX + 1] = {0};

+ 0 - 365
system_basic_info/SystemAnalysis.h

@@ -1,365 +0,0 @@
-#ifndef BASIC_SYSTEM_ANALYSIS
-#define BASIC_SYSTEM_ANALYSIS
-
-
-//Station analysis
-typedef enum StationSyncBasicBranch 
-{
-    LOCATION_SYSTEM_BRANCH_0 = 0,     //used
-    LOCATION_SYSTEM_BRANCH_1,         //used
-    LOCATION_SYSTEM_BRANCH_2,         //used
-    LOCATION_SYSTEM_BRANCH_3,         //used
-    LOCATION_SYSTEM_BRANCH_4,         //used
-    LOCATION_SYSTEM_BRANCH_5,         //used
-    LOCATION_SYSTEM_BRANCH_6,         //used
-    LOCATION_SYSTEM_BRANCH_7,         //used
-    LOCATION_SYSTEM_BRANCH_8,         //used
-    LOCATION_SYSTEM_BRANCH_9,         //used
-    LOCATION_SYSTEM_BRANCH_10,        //used
-    LOCATION_SYSTEM_BRANCH_11,        //used
-    LOCATION_SYSTEM_BRANCH_12,        //used
-    LOCATION_SYSTEM_BRANCH_13,        //used
-    LOCATION_SYSTEM_BRANCH_14,        //used
-    LOCATION_SYSTEM_BRANCH_15,        //used
-    LOCATION_SYSTEM_BRANCH_16,        //used
-    LOCATION_SYSTEM_BRANCH_17,        //used
-    LOCATION_SYSTEM_BRANCH_18,        //used
-    LOCATION_SYSTEM_BRANCH_19,        //used
-    LOCATION_SYSTEM_BRANCH_20,        //used
-    LOCATION_SYSTEM_BRANCH_21,        //used
-    LOCATION_SYSTEM_BRANCH_22,        //used
-    LOCATION_SYSTEM_BRANCH_23,        //used
-    LOCATION_SYSTEM_BRANCH_24,        //used
-    LOCATION_SYSTEM_BRANCH_25,        //used
-    LOCATION_SYSTEM_BRANCH_26,        //used
-    LOCATION_SYSTEM_BRANCH_27,        //used
-    LOCATION_SYSTEM_BRANCH_28,        //used
-    LOCATION_SYSTEM_BRANCH_29,        //used
-    LOCATION_SYSTEM_BRANCH_30,        //used
-    LOCATION_SYSTEM_BRANCH_31,        //used
-    LOCATION_SYSTEM_BRANCH_32,        //used
-    LOCATION_SYSTEM_BRANCH_33,        //used
-    LOCATION_SYSTEM_BRANCH_34,        //used
-    LOCATION_SYSTEM_BRANCH_35,        //used
-    LOCATION_SYSTEM_BRANCH_36,        //used
-    LOCATION_SYSTEM_BRANCH_37,        //used
-    LOCATION_SYSTEM_BRANCH_38,        //used
-    LOCATION_SYSTEM_BRANCH_39,        //used
-    LOCATION_SYSTEM_BRANCH_40,        //used
-    LOCATION_SYSTEM_BRANCH_41,        //used
-    LOCATION_SYSTEM_BRANCH_42,        //used
-    LOCATION_SYSTEM_BRANCH_43,        //used
-    LOCATION_SYSTEM_BRANCH_44,        //used
-    LOCATION_SYSTEM_BRANCH_45,        //used
-    LOCATION_SYSTEM_BRANCH_46,        //used
-    LOCATION_SYSTEM_BRANCH_47,        //used
-    LOCATION_SYSTEM_BRANCH_48,        //used
-    LOCATION_SYSTEM_BRANCH_49,        //used
-    LOCATION_SYSTEM_BRANCH_50,        //used
-    LOCATION_SYSTEM_BRANCH_51,        //used
-    LOCATION_SYSTEM_BRANCH_52,        //used
-    LOCATION_SYSTEM_BRANCH_53,        //used
-    LOCATION_SYSTEM_BRANCH_54,        //used
-    LOCATION_SYSTEM_BRANCH_55,        //used
-    LOCATION_SYSTEM_BRANCH_56,        //used
-    LOCATION_SYSTEM_BRANCH_57,        //used
-    LOCATION_SYSTEM_BRANCH_58,        //used
-    LOCATION_SYSTEM_BRANCH_59,        //used
-    LOCATION_SYSTEM_BRANCH_60,        //used
-    LOCATION_SYSTEM_BRANCH_61,        //used
-    LOCATION_SYSTEM_BRANCH_62,        //used
-    LOCATION_SYSTEM_BRANCH_63,        //used
-    LOCATION_SYSTEM_BRANCH_64,        //used
-    LOCATION_SYSTEM_BRANCH_65,        //used
-    LOCATION_SYSTEM_BRANCH_66,        //used
-    LOCATION_SYSTEM_BRANCH_67,        //used
-    LOCATION_SYSTEM_BRANCH_68,        //used
-    LOCATION_SYSTEM_BRANCH_69,        //used
-    LOCATION_SYSTEM_BRANCH_70,        //used
-    LOCATION_SYSTEM_BRANCH_71,        //used
-    LOCATION_SYSTEM_BRANCH_72,        //used
-    LOCATION_SYSTEM_BRANCH_73,        //used
-    LOCATION_SYSTEM_BRANCH_74,        //used
-    LOCATION_SYSTEM_BRANCH_75,        //used
-    LOCATION_SYSTEM_BRANCH_76,        //used
-    LOCATION_SYSTEM_BRANCH_77,        //used
-    LOCATION_SYSTEM_BRANCH_78,        //used
-    LOCATION_SYSTEM_BRANCH_79,        //used
-    LOCATION_SYSTEM_BRANCH_80,        //used
-    LOCATION_SYSTEM_BRANCH_81,        //used
-    LOCATION_SYSTEM_BRANCH_82,        //used
-    LOCATION_SYSTEM_BRANCH_83,        //used
-    LOCATION_SYSTEM_BRANCH_84,        //used
-    LOCATION_SYSTEM_BRANCH_85,        //used
-    LOCATION_SYSTEM_BRANCH_86,        //used
-    LOCATION_SYSTEM_BRANCH_87,        //used
-    LOCATION_SYSTEM_BRANCH_88,        //used
-    LOCATION_SYSTEM_BRANCH_89,        //used
-    LOCATION_SYSTEM_BRANCH_90,        //used
-    LOCATION_SYSTEM_BRANCH_91,        //used
-    LOCATION_SYSTEM_BRANCH_92,        //used
-    LOCATION_SYSTEM_BRANCH_93,        //used
-    LOCATION_SYSTEM_BRANCH_94,        //used
-    LOCATION_SYSTEM_BRANCH_95,        //used
-    LOCATION_SYSTEM_BRANCH_96,        //used
-    LOCATION_SYSTEM_BRANCH_97,        //used
-    LOCATION_SYSTEM_BRANCH_98,        //used
-    LOCATION_SYSTEM_BRANCH_99,        //used
-    LOCATION_SYSTEM_BRANCH_100,       //used
-    LOCATION_SYSTEM_BRANCH_101,       //used
-    LOCATION_SYSTEM_BRANCH_102,       //used
-    LOCATION_SYSTEM_BRANCH_103,       //used
-    LOCATION_SYSTEM_BRANCH_104,       //used
-    LOCATION_SYSTEM_BRANCH_105,       //used
-    LOCATION_SYSTEM_BRANCH_106,       //used
-    LOCATION_SYSTEM_BRANCH_107,       //used
-    LOCATION_SYSTEM_BRANCH_108,       //used
-    LOCATION_SYSTEM_BRANCH_109,       //used
-    LOCATION_SYSTEM_BRANCH_110,       //used
-    LOCATION_SYSTEM_BRANCH_111,       //used
-    LOCATION_SYSTEM_BRANCH_112,       //used
-    LOCATION_SYSTEM_BRANCH_113,       //used
-    LOCATION_SYSTEM_BRANCH_114,       //used
-    LOCATION_SYSTEM_BRANCH_115,       //used
-    LOCATION_SYSTEM_BRANCH_116,       //used
-    LOCATION_SYSTEM_BRANCH_117,       //used
-    LOCATION_SYSTEM_BRANCH_118,       //used
-    LOCATION_SYSTEM_BRANCH_119,       //used
-    LOCATION_SYSTEM_BRANCH_120,       //used
-    LOCATION_SYSTEM_BRANCH_121,       //used
-    LOCATION_SYSTEM_BRANCH_122,       //used
-    LOCATION_SYSTEM_BRANCH_123,       //used
-    LOCATION_SYSTEM_BRANCH_124,       //used
-    LOCATION_SYSTEM_BRANCH_125,       //used
-    LOCATION_SYSTEM_BRANCH_126,       //used
-    LOCATION_SYSTEM_BRANCH_127,       //used
-    LOCATION_SYSTEM_BRANCH_128,       //used
-    LOCATION_SYSTEM_BRANCH_129,       //used
-    LOCATION_SYSTEM_BRANCH_130,       //used
-    LOCATION_SYSTEM_BRANCH_131,       //used
-    LOCATION_SYSTEM_BRANCH_132,       //used
-    LOCATION_SYSTEM_BRANCH_133,       //used
-    LOCATION_SYSTEM_BRANCH_134,       //used
-    LOCATION_SYSTEM_BRANCH_135,       //used
-    LOCATION_SYSTEM_BRANCH_136,       //used
-    LOCATION_SYSTEM_BRANCH_137,       //used
-    LOCATION_SYSTEM_BRANCH_138,       //used
-    LOCATION_SYSTEM_BRANCH_139,       //used
-    LOCATION_SYSTEM_BRANCH_140,       //used
-    LOCATION_SYSTEM_BRANCH_141,       //used
-    LOCATION_SYSTEM_BRANCH_142,       //used
-    LOCATION_SYSTEM_BRANCH_143,       //used
-    LOCATION_SYSTEM_BRANCH_144,       //used
-    LOCATION_SYSTEM_BRANCH_145,       //used
-    LOCATION_SYSTEM_BRANCH_146,       //used
-    LOCATION_SYSTEM_BRANCH_147,       //used
-    LOCATION_SYSTEM_BRANCH_148,       //used
-    LOCATION_SYSTEM_BRANCH_149,       //used
-	LOCATION_SYSTEM_BRANCH_150,       //used
-	LOCATION_SYSTEM_BRANCH_151,       //used
-	LOCATION_SYSTEM_BRANCH_152,       //used
-	LOCATION_SYSTEM_BRANCH_153,       //used
-	LOCATION_SYSTEM_BRANCH_154,       //used
-	LOCATION_SYSTEM_BRANCH_155,       //used
-	LOCATION_SYSTEM_BRANCH_156,       //used
-	LOCATION_SYSTEM_BRANCH_157,       //used
-	LOCATION_SYSTEM_BRANCH_158,       //used
-	LOCATION_SYSTEM_BRANCH_159,       //used
-	LOCATION_SYSTEM_BRANCH_160,       //used
-	LOCATION_SYSTEM_BRANCH_161,       //used
-	LOCATION_SYSTEM_BRANCH_162,       //used
-	LOCATION_SYSTEM_BRANCH_163,       //used
-	LOCATION_SYSTEM_BRANCH_164,       //used
-	LOCATION_SYSTEM_BRANCH_165,       //used
-	LOCATION_SYSTEM_BRANCH_166,       //used
-	LOCATION_SYSTEM_BRANCH_167,       //used
-	LOCATION_SYSTEM_BRANCH_168,       //used
-	LOCATION_SYSTEM_BRANCH_169,       //used
-	LOCATION_SYSTEM_BRANCH_170,       //used
-	LOCATION_SYSTEM_BRANCH_171,       //used
-	LOCATION_SYSTEM_BRANCH_172,       //used
-	LOCATION_SYSTEM_BRANCH_173,       //used
-	LOCATION_SYSTEM_BRANCH_174,       //used
-	LOCATION_SYSTEM_BRANCH_175,       //used
-	LOCATION_SYSTEM_BRANCH_176,       //used
-	LOCATION_SYSTEM_BRANCH_177,       //used
-	LOCATION_SYSTEM_BRANCH_178,       //used
-	LOCATION_SYSTEM_BRANCH_179,       //used
-	LOCATION_SYSTEM_BRANCH_180,       //used
-	LOCATION_SYSTEM_BRANCH_181,       //used
-	LOCATION_SYSTEM_BRANCH_182,       //used
-	LOCATION_SYSTEM_BRANCH_183,       //used
-	LOCATION_SYSTEM_BRANCH_184,       //used
-	LOCATION_SYSTEM_BRANCH_185,       //used
-	LOCATION_SYSTEM_BRANCH_186,       //used
-	LOCATION_SYSTEM_BRANCH_187,       //used
-	LOCATION_SYSTEM_BRANCH_188,       //used
-	LOCATION_SYSTEM_BRANCH_189,       //used
-	LOCATION_SYSTEM_BRANCH_190,       //used
-	LOCATION_SYSTEM_BRANCH_191,       //used
-	LOCATION_SYSTEM_BRANCH_192,       //used
-	LOCATION_SYSTEM_BRANCH_193,       //used
-	LOCATION_SYSTEM_BRANCH_194,       //used
-	LOCATION_SYSTEM_BRANCH_195,       //used
-	LOCATION_SYSTEM_BRANCH_196,       //used
-	LOCATION_SYSTEM_BRANCH_197,       //used
-	LOCATION_SYSTEM_BRANCH_198,       //used
-	LOCATION_SYSTEM_BRANCH_199,       //used
-	LOCATION_SYSTEM_BRANCH_200,       //used
-	LOCATION_SYSTEM_BRANCH_201,       //used
-	LOCATION_SYSTEM_BRANCH_202,       //used
-	LOCATION_SYSTEM_BRANCH_203,       //used
-	LOCATION_SYSTEM_BRANCH_204,       //used
-	LOCATION_SYSTEM_BRANCH_205,       //used
-	LOCATION_SYSTEM_BRANCH_206,       //used
-	LOCATION_SYSTEM_BRANCH_207,       //used
-	LOCATION_SYSTEM_BRANCH_208,       //used
-	LOCATION_SYSTEM_BRANCH_209,       //used
-	LOCATION_SYSTEM_BRANCH_210,       //used
-	LOCATION_SYSTEM_BRANCH_211,       //used
-	LOCATION_SYSTEM_BRANCH_212,       //used
-	LOCATION_SYSTEM_BRANCH_213,       //used
-	LOCATION_SYSTEM_BRANCH_214,       //used
-	LOCATION_SYSTEM_BRANCH_215,       //used
-	LOCATION_SYSTEM_BRANCH_216,       //used
-	LOCATION_SYSTEM_BRANCH_217,       //used
-	LOCATION_SYSTEM_BRANCH_218,       //used
-	LOCATION_SYSTEM_BRANCH_219,       //used
-	LOCATION_SYSTEM_BRANCH_220,       //used
-	LOCATION_SYSTEM_BRANCH_221,       //used
-	LOCATION_SYSTEM_BRANCH_222,       //used
-	LOCATION_SYSTEM_BRANCH_223,       //used
-	LOCATION_SYSTEM_BRANCH_224,       //used
-	LOCATION_SYSTEM_BRANCH_225,       //used
-	LOCATION_SYSTEM_BRANCH_226,       //used
-	LOCATION_SYSTEM_BRANCH_227,       //used
-	LOCATION_SYSTEM_BRANCH_228,       //used
-	LOCATION_SYSTEM_BRANCH_229,       //used
-	LOCATION_SYSTEM_BRANCH_230,       //used
-	LOCATION_SYSTEM_BRANCH_231,       //used
-	LOCATION_SYSTEM_BRANCH_232,       //used
-	LOCATION_SYSTEM_BRANCH_233,       //used
-	LOCATION_SYSTEM_BRANCH_234,       //used
-	LOCATION_SYSTEM_BRANCH_235,       //used
-	LOCATION_SYSTEM_BRANCH_236,       //used
-	LOCATION_SYSTEM_BRANCH_237,       //used
-	LOCATION_SYSTEM_BRANCH_238,       //used
-	LOCATION_SYSTEM_BRANCH_239,       //used
-	LOCATION_SYSTEM_BRANCH_240,       //used
-	LOCATION_SYSTEM_BRANCH_241,       //used
-	LOCATION_SYSTEM_BRANCH_242,       //used
-	LOCATION_SYSTEM_BRANCH_243,       //used
-	LOCATION_SYSTEM_BRANCH_244,       //used
-	LOCATION_SYSTEM_BRANCH_245,       //used
-	LOCATION_SYSTEM_BRANCH_246,       //used
-	LOCATION_SYSTEM_BRANCH_247,       //used
-	LOCATION_SYSTEM_BRANCH_248,       //used
-	LOCATION_SYSTEM_BRANCH_249,       //used
-	LOCATION_SYSTEM_BRANCH_250,       //used
-	LOCATION_SYSTEM_BRANCH_251,       //used
-	LOCATION_SYSTEM_BRANCH_252,       //used
-	LOCATION_SYSTEM_BRANCH_253,       //used
-	LOCATION_SYSTEM_BRANCH_254,       //used
-	LOCATION_SYSTEM_BRANCH_255,       //used
-	LOCATION_SYSTEM_BRANCH_256,       //used
-	LOCATION_SYSTEM_BRANCH_257,       //used
-	LOCATION_SYSTEM_BRANCH_258,       //used
-	LOCATION_SYSTEM_BRANCH_259,       //used
-	LOCATION_SYSTEM_BRANCH_260,       //used
-	LOCATION_SYSTEM_BRANCH_261,       //used
-	LOCATION_SYSTEM_BRANCH_262,       //used
-	LOCATION_SYSTEM_BRANCH_263,       //used
-	LOCATION_SYSTEM_BRANCH_264,       //used
-	LOCATION_SYSTEM_BRANCH_265,       //used
-	LOCATION_SYSTEM_BRANCH_266,       //used
-	LOCATION_SYSTEM_BRANCH_267,		  //used
-	LOCATION_SYSTEM_BRANCH_268,       //used
-	LOCATION_SYSTEM_BRANCH_269,		  //used
-	LOCATION_SYSTEM_BRANCH_270,       //used
-	LOCATION_SYSTEM_BRANCH_271,		  //used
-	LOCATION_SYSTEM_BRANCH_272,	      //used
-	LOCATION_SYSTEM_BRANCH_273,       //used
-	LOCATION_SYSTEM_BRANCH_274,		  //used
-	LOCATION_SYSTEM_BRANCH_275,
-	LOCATION_SYSTEM_BRANCH_276,
-	LOCATION_SYSTEM_BRANCH_277,
-	LOCATION_SYSTEM_BRANCH_278,
-	LOCATION_SYSTEM_BRANCH_279,
-	LOCATION_SYSTEM_BRANCH_280,
-	LOCATION_SYSTEM_BRANCH_281,
-	LOCATION_SYSTEM_BRANCH_282,
-	LOCATION_SYSTEM_BRANCH_283,
-	LOCATION_SYSTEM_BRANCH_284,
-	LOCATION_SYSTEM_BRANCH_285,
-	LOCATION_SYSTEM_BRANCH_286,
-	LOCATION_SYSTEM_BRANCH_287,
-	LOCATION_SYSTEM_BRANCH_288,
-	LOCATION_SYSTEM_BRANCH_289,
-	LOCATION_SYSTEM_BRANCH_290,
-	LOCATION_SYSTEM_BRANCH_291,
-	LOCATION_SYSTEM_BRANCH_292,
-	LOCATION_SYSTEM_BRANCH_293,
-	LOCATION_SYSTEM_BRANCH_294,
-	LOCATION_SYSTEM_BRANCH_295,
-	LOCATION_SYSTEM_BRANCH_296,
-	LOCATION_SYSTEM_BRANCH_297,
-	LOCATION_SYSTEM_BRANCH_298,
-	LOCATION_SYSTEM_BRANCH_299,
-	LOCATION_SYSTEM_BRANCH_300,
-	LOCATION_SYSTEM_BRANCH_301,
-	LOCATION_SYSTEM_BRANCH_302,
-	LOCATION_SYSTEM_BRANCH_303,
-	LOCATION_SYSTEM_BRANCH_304,
-	LOCATION_SYSTEM_BRANCH_305,
-	LOCATION_SYSTEM_BRANCH_306,
-    LOCATION_SYSTEM_BRANCH_MAX
-}StationSyncBasicBranch;
-
-//#define LOCATION_SYSTEM_BRANCH_MAX        20
-extern int LocationSystemCount[LOCATION_SYSTEM_BRANCH_MAX+1];
-
-#define  LOCATION_SYSTEM_BRANCH(x)    ((LocationSystemCount[x])++)
-
-//Tag location analysis
-#define TAG_LOCATION_BRANCH_MAX        20
-extern int TagLocationSystemFlag[TAG_LOCATION_BRANCH_MAX + 1];
-
-typedef enum TagLocationBasicBranch 
-{
-	TAG_LOCATION_BRANCH_0 = 0,   //used
-	TAG_LOCATION_BRANCH_1,       //used
-	TAG_LOCATION_BRANCH_2,       //used
-	TAG_LOCATION_BRANCH_3,
-	TAG_LOCATION_BRANCH_4, 
-	TAG_LOCATION_BRANCH_5, 
-	TAG_LOCATION_BRANCH_6,
-	TAG_LOCATION_BRANCH_7,
-	TAG_LOCATION_BRANCH_8, 
-	TAG_LOCATION_BRANCH_9, 
-	TAG_LOCATION_BRANCH_10,
-	TAG_LOCATION_BRANCH_11,
-	TAG_LOCATION_BRANCH_12, 
-	TAG_LOCATION_BRANCH_13, 
-	TAG_LOCATION_BRANCH_14,
-	TAG_LOCATION_BRANCH_15,
-	TAG_LOCATION_BRANCH_16, 
-	TAG_LOCATION_BRANCH_17, 
-	TAG_LOCATION_BRANCH_18,
-	TAG_LOCATION_BRANCH_19,
-}TagLocationBasicBranch;
-
-#define  TAG_LOCATION_BRANCH(x)    ((TagLocationSystemFlag[x])++)
-
-
-
-
-
-
-
-
-
-
-
-
-
-#endif

+ 0 - 1
worker.h

@@ -6,7 +6,6 @@ struct task
 {
 	uint32_t m_cmd_code;
 	uint32_t m_hash_id;
-	int      m_site_data = 0;
 	char     m_d[1];
 
 	void destroy()