|
@@ -20,6 +20,7 @@
|
|
#include "ant.h"
|
|
#include "ant.h"
|
|
#include "mine.h"
|
|
#include "mine.h"
|
|
#include "module_service/module_mgr.h"
|
|
#include "module_service/module_mgr.h"
|
|
|
|
+#include "visit.h"
|
|
|
|
|
|
extern config_file config;
|
|
extern config_file config;
|
|
//一张卡一个ct的所有不同天线的信息
|
|
//一张卡一个ct的所有不同天线的信息
|
|
@@ -214,10 +215,6 @@ struct person:card_location_base, card_area
|
|
|
|
|
|
void clear()
|
|
void clear()
|
|
{
|
|
{
|
|
- //清除定时器
|
|
|
|
- m_timer.stop();
|
|
|
|
- m_loop = nullptr;
|
|
|
|
-
|
|
|
|
m_site_area.reset(new site_area_hover);
|
|
m_site_area.reset(new site_area_hover);
|
|
m_area_tool.reset(new area_tool);
|
|
m_area_tool.reset(new area_tool);
|
|
m_mine_tool.reset(new mine_tool);
|
|
m_mine_tool.reset(new mine_tool);
|
|
@@ -259,17 +256,6 @@ struct person:card_location_base, card_area
|
|
}
|
|
}
|
|
//人卡升井后该线程要停掉
|
|
//人卡升井后该线程要停掉
|
|
//手动升级需要补全区域得同时,需要进区域走区域业务
|
|
//手动升级需要补全区域得同时,需要进区域走区域业务
|
|
- void set(ev::dynamic_loop * loop)
|
|
|
|
- {
|
|
|
|
- if(!m_mine_tool->is_attendance())
|
|
|
|
- return;
|
|
|
|
- log_info("person_is_on_att......%d",m_id);
|
|
|
|
- m_loop = loop;
|
|
|
|
-
|
|
|
|
- m_timer.set(*m_loop);
|
|
|
|
- m_timer.set<person,&person::on_timer>(this);
|
|
|
|
- m_timer.start(10,1);
|
|
|
|
- }
|
|
|
|
void reset(std::shared_ptr<monkey_person> mp)
|
|
void reset(std::shared_ptr<monkey_person> mp)
|
|
{
|
|
{
|
|
m_monkeyPerson = mp;
|
|
m_monkeyPerson = mp;
|
|
@@ -278,6 +264,8 @@ struct person:card_location_base, card_area
|
|
private:
|
|
private:
|
|
void on_timer()
|
|
void on_timer()
|
|
{
|
|
{
|
|
|
|
+ if(!m_mine_tool->is_attendance())
|
|
|
|
+ return;
|
|
YA::_CARD_POS_ cp;
|
|
YA::_CARD_POS_ cp;
|
|
point pt = getSmoothPoint();
|
|
point pt = getSmoothPoint();
|
|
const auto lm = m_area_tool->getLandmark();
|
|
const auto lm = m_area_tool->getLandmark();
|
|
@@ -364,16 +352,6 @@ struct car:card_location_base,card_area
|
|
m_mine_tool->on_point(m_id, m_type, m_vehicle_category_id);
|
|
m_mine_tool->on_point(m_id, m_type, m_vehicle_category_id);
|
|
}
|
|
}
|
|
|
|
|
|
- void set(ev::dynamic_loop * loop)
|
|
|
|
- {
|
|
|
|
- log_info("cardid_id %d",m_id);
|
|
|
|
- m_loop = loop;
|
|
|
|
-
|
|
|
|
- m_timer.set(*m_loop);
|
|
|
|
- m_timer.set<car,&car::on_timer>(this);
|
|
|
|
- m_timer.start(1,1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
int get_vehicle_type_id()
|
|
int get_vehicle_type_id()
|
|
{
|
|
{
|
|
return m_vehicle_type_id;
|
|
return m_vehicle_type_id;
|
|
@@ -594,6 +572,7 @@ void card_list::load_his_card_postion_from_db()
|
|
{
|
|
{
|
|
load_his_card_postion_vehicle();
|
|
load_his_card_postion_vehicle();
|
|
load_his_card_postion_staff();
|
|
load_his_card_postion_staff();
|
|
|
|
+ run();
|
|
|
|
|
|
for(auto&iter: m_map)
|
|
for(auto&iter: m_map)
|
|
{
|
|
{
|
|
@@ -875,6 +854,23 @@ void card_list::on_message(zloop<task*> *loop,const message_locinfo&loc,bool is_
|
|
|
|
|
|
c->on_message(loop,loc,is_history);
|
|
c->on_message(loop,loc,is_history);
|
|
}
|
|
}
|
|
|
|
+struct local_visit:visitor<std::shared_ptr<card_location_base>>
|
|
|
|
+{
|
|
|
|
+ bool visit(std::shared_ptr<card_location_base> c)
|
|
|
|
+ {
|
|
|
|
+ c->on_timer();
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+void card_list::onTimer()
|
|
|
|
+{
|
|
|
|
+ local_visit lv;
|
|
|
|
+ while(!m_bflag)
|
|
|
|
+ {
|
|
|
|
+ card_list::instance()->accept(lv);
|
|
|
|
+ std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
|
|
+ }
|
|
|
|
+}
|
|
//-----------------card_location_base..
|
|
//-----------------card_location_base..
|
|
card_location_base::card_location_base(std::string type,uint32_t id,uint16_t dis,int16_t t,int32_t deptid,int32_t level_id)
|
|
card_location_base::card_location_base(std::string type,uint32_t id,uint16_t dis,int16_t t,int32_t deptid,int32_t level_id)
|
|
:card(id,dis,t,deptid,level_id)
|
|
:card(id,dis,t,deptid,level_id)
|
|
@@ -912,8 +908,6 @@ void card_location_base::on_location(const std::vector<point>&vp,const std::vect
|
|
|
|
|
|
void card_location_base::on_message(zloop<task*> * loop,const message_locinfo&loc,bool is_history)
|
|
void card_location_base::on_message(zloop<task*> * loop,const message_locinfo&loc,bool is_history)
|
|
{
|
|
{
|
|
- if(m_loop == nullptr && loop != nullptr)
|
|
|
|
- set(loop);
|
|
|
|
m_ct = loc.m_card_ct;
|
|
m_ct = loc.m_card_ct;
|
|
m_time = loc.m_time_stamp;
|
|
m_time = loc.m_time_stamp;
|
|
m_message_handle->on_message(loop,loc,is_history);
|
|
m_message_handle->on_message(loop,loc,is_history);
|