|
@@ -21,6 +21,7 @@
|
|
#include "mine.h"
|
|
#include "mine.h"
|
|
#include "module_service/module_mgr.h"
|
|
#include "module_service/module_mgr.h"
|
|
#include "visit.h"
|
|
#include "visit.h"
|
|
|
|
+#include "his_location.h"
|
|
|
|
|
|
extern config_file config;
|
|
extern config_file config;
|
|
//一张卡一个ct的所有不同天线的信息
|
|
//一张卡一个ct的所有不同天线的信息
|
|
@@ -201,11 +202,11 @@ struct card_area
|
|
struct person:card_location_base, card_area
|
|
struct person:card_location_base, card_area
|
|
{
|
|
{
|
|
std::weak_ptr<monkey_person> m_monkeyPerson;
|
|
std::weak_ptr<monkey_person> m_monkeyPerson;
|
|
-
|
|
|
|
person(std::string type,uint32_t cardid,uint16_t needdisplay,int16_t t,int32_t deptid,int32_t level_id)
|
|
person(std::string type,uint32_t cardid,uint16_t needdisplay,int16_t t,int32_t deptid,int32_t level_id)
|
|
:card_location_base(type,cardid,needdisplay,t,deptid,level_id)
|
|
:card_location_base(type,cardid,needdisplay,t,deptid,level_id)
|
|
{
|
|
{
|
|
- m_message_handle = new card_message_handle(this);
|
|
|
|
|
|
+ m_message_handle.reset(new card_message_handle(this));
|
|
|
|
+ m_his_location_card.reset(new location_staff(m_id,m_type));
|
|
}
|
|
}
|
|
|
|
|
|
void on_message(zloop<task*> * loop,const message_locinfo&loc,bool is_history)
|
|
void on_message(zloop<task*> * loop,const message_locinfo&loc,bool is_history)
|
|
@@ -248,14 +249,9 @@ struct person:card_location_base, card_area
|
|
|
|
|
|
virtual void do_business(const point &pt)
|
|
virtual void do_business(const point &pt)
|
|
{
|
|
{
|
|
- //区域
|
|
|
|
m_area_tool->on_point(m_id,pt,m_speed,m_type);
|
|
m_area_tool->on_point(m_id,pt,m_speed,m_type);
|
|
- //考勤
|
|
|
|
m_site_area->on_point(m_id,0,this, m_type);
|
|
m_site_area->on_point(m_id,0,this, m_type);
|
|
- //
|
|
|
|
}
|
|
}
|
|
- //人卡升井后该线程要停掉
|
|
|
|
- //手动升级需要补全区域得同时,需要进区域走区域业务
|
|
|
|
void reset(std::shared_ptr<monkey_person> mp)
|
|
void reset(std::shared_ptr<monkey_person> mp)
|
|
{
|
|
{
|
|
m_monkeyPerson = mp;
|
|
m_monkeyPerson = mp;
|
|
@@ -267,15 +263,16 @@ private:
|
|
if(!m_mine_tool->is_attendance())
|
|
if(!m_mine_tool->is_attendance())
|
|
return;
|
|
return;
|
|
YA::_CARD_POS_ cp;
|
|
YA::_CARD_POS_ cp;
|
|
- point pt = getSmoothPoint();
|
|
|
|
|
|
+ uint64_t _time=0;
|
|
|
|
+ point pt = getSmoothPoint(_time);
|
|
const auto lm = m_area_tool->getLandmark();
|
|
const auto lm = m_area_tool->getLandmark();
|
|
|
|
|
|
cp.enter_area_time = std::get<0>(lm)*1000;
|
|
cp.enter_area_time = std::get<0>(lm)*1000;
|
|
cp.rec_time = std::get<1>(lm);
|
|
cp.rec_time = std::get<1>(lm);
|
|
|
|
|
|
- cp.map_id = std::get<2>(lm);
|
|
|
|
- cp.area_id = std::get<3>(lm);
|
|
|
|
-
|
|
|
|
|
|
+ int32_t map_id = std::get<2>(lm);
|
|
|
|
+ int32_t area_id = std::get<3>(lm);
|
|
|
|
+ cp.map_id=map_id;cp.area_id=area_id;
|
|
cp.landmark_id = std::get<4>(lm);
|
|
cp.landmark_id = std::get<4>(lm);
|
|
cp.lm_direction = std::get<5>(lm);
|
|
cp.lm_direction = std::get<5>(lm);
|
|
cp.landmark_dis=std::get<6>(lm);
|
|
cp.landmark_dis=std::get<6>(lm);
|
|
@@ -284,10 +281,10 @@ private:
|
|
cp.down_time = m_mine_tool->get_down_time();
|
|
cp.down_time = m_mine_tool->get_down_time();
|
|
cp.work_time = m_mine_tool->get_work_time();
|
|
cp.work_time = m_mine_tool->get_work_time();
|
|
cp.is_on_duty= m_mine_tool->is_on_duty();
|
|
cp.is_on_duty= m_mine_tool->is_on_duty();
|
|
-
|
|
|
|
|
|
+ m_his_location_card->push(_time,pt,area_id,map_id);
|
|
upt_card_pos(cp,pt);
|
|
upt_card_pos(cp,pt);
|
|
}
|
|
}
|
|
- point getSmoothPoint()
|
|
|
|
|
|
+ point getSmoothPoint(uint64_t t)
|
|
{
|
|
{
|
|
point pt;
|
|
point pt;
|
|
loc_point lp = m_smo_tool->smooth_strategy();
|
|
loc_point lp = m_smo_tool->smooth_strategy();
|
|
@@ -295,12 +292,13 @@ private:
|
|
m_stat = lp.m_stat;
|
|
m_stat = lp.m_stat;
|
|
pt.x = lp.x;
|
|
pt.x = lp.x;
|
|
pt.y = -lp.y;
|
|
pt.y = -lp.y;
|
|
|
|
+ t=lp.m_time;
|
|
if(auto p = m_monkeyPerson.lock() )
|
|
if(auto p = m_monkeyPerson.lock() )
|
|
{
|
|
{
|
|
if(p->is_on_bus())
|
|
if(p->is_on_bus())
|
|
{
|
|
{
|
|
m_stat = 7;
|
|
m_stat = 7;
|
|
- pt = p->getPoint();
|
|
|
|
|
|
+ pt = p->getPoint(t);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return pt;
|
|
return pt;
|
|
@@ -317,7 +315,8 @@ struct car:card_location_base,card_area
|
|
,m_vehicle_category_id(categoryid)
|
|
,m_vehicle_category_id(categoryid)
|
|
,m_vehicle_type_id(type_id)
|
|
,m_vehicle_type_id(type_id)
|
|
{
|
|
{
|
|
- m_message_handle=new card_message_handle(this);
|
|
|
|
|
|
+ m_message_handle.reset(new card_message_handle(this));
|
|
|
|
+ m_his_location_card.reset(new location_vehicle(m_id,m_type));
|
|
}
|
|
}
|
|
|
|
|
|
virtual void site_hover(int sid)
|
|
virtual void site_hover(int sid)
|
|
@@ -383,13 +382,14 @@ private:
|
|
{
|
|
{
|
|
int32_t special_id=-1;
|
|
int32_t special_id=-1;
|
|
YA::_CARD_POS_ cp;
|
|
YA::_CARD_POS_ cp;
|
|
- point pt = getSmoothPoint();
|
|
|
|
|
|
+ loc_point pt = getSmoothPoint();
|
|
|
|
|
|
const auto lm = m_area_tool->getLandmark();
|
|
const auto lm = m_area_tool->getLandmark();
|
|
cp.enter_area_time = std::get<0>(lm);
|
|
cp.enter_area_time = std::get<0>(lm);
|
|
cp.rec_time = std::get<1>(lm);
|
|
cp.rec_time = std::get<1>(lm);
|
|
- cp.map_id = std::get<2>(lm);
|
|
|
|
- cp.area_id = std::get<3>(lm);
|
|
|
|
|
|
+ uint32_t map_id = std::get<2>(lm);
|
|
|
|
+ uint32_t area_id = std::get<3>(lm);
|
|
|
|
+ cp.map_id =map_id;cp.area_id=area_id;
|
|
cp.landmark_id = std::get<4>(lm);
|
|
cp.landmark_id = std::get<4>(lm);
|
|
cp.lm_direction = std::get<5>(lm);
|
|
cp.lm_direction = std::get<5>(lm);
|
|
cp.landmark_dis=std::get<6>(lm);
|
|
cp.landmark_dis=std::get<6>(lm);
|
|
@@ -400,14 +400,14 @@ private:
|
|
//for now
|
|
//for now
|
|
cp.is_on_duty=m_mine_tool->is_on_duty();
|
|
cp.is_on_duty=m_mine_tool->is_on_duty();
|
|
upt_card_pos(cp,pt);
|
|
upt_card_pos(cp,pt);
|
|
-
|
|
|
|
|
|
+ m_his_location_card->push(pt.m_time,pt,area_id,map_id);
|
|
if(biz_stat==STATUS_LOST && special_id != -1 && m_display==1)
|
|
if(biz_stat==STATUS_LOST && special_id != -1 && m_display==1)
|
|
{
|
|
{
|
|
cp.area_id = special_id;
|
|
cp.area_id = special_id;
|
|
swsClientMgr.SendSpecialAreaProcess(cp);
|
|
swsClientMgr.SendSpecialAreaProcess(cp);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- point getSmoothPoint()
|
|
|
|
|
|
+ loc_point getSmoothPoint()
|
|
{
|
|
{
|
|
loc_point lp = m_smo_tool->smooth_strategy();
|
|
loc_point lp = m_smo_tool->smooth_strategy();
|
|
m_speed = lp.m_speed;
|
|
m_speed = lp.m_speed;
|