|
@@ -50,7 +50,7 @@ card_location_base::card_location_base(const std::string&type,uint32_t id,uint16
|
|
|
void card_location_base::do_status(int st)
|
|
|
{
|
|
|
time_t now = time(0);
|
|
|
- bool help_flag = false;
|
|
|
+ //bool help_flag = false;
|
|
|
|
|
|
log_info("[help-battery] card_id=%d, help_bit=%d, status=%d", m_id, m_help_bit, st);
|
|
|
// 呼救
|
|
@@ -74,7 +74,7 @@ void card_location_base::do_status(int st)
|
|
|
if((m_help_bit&0x3)==2)
|
|
|
{
|
|
|
//log_warn("[help-battery] handle_m_help, card_id=%d",m_id);
|
|
|
- help_flag=true;
|
|
|
+ //help_flag=true;
|
|
|
}
|
|
|
|
|
|
m_help_last_time = now;
|
|
@@ -137,6 +137,22 @@ void card_location_base::make_his_location(uint64_t t,const point & pt,bool bclo
|
|
|
//坐标点输入业务入口
|
|
|
void card_location_base::on_location(const std::vector<point>&vp, const std::vector<loc_message> &lm, bool is_v_map)
|
|
|
{
|
|
|
+ m_isVehicleMap = false;
|
|
|
+ if (is_vehicle())
|
|
|
+ {
|
|
|
+ if (!is_v_map)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (is_person())
|
|
|
+ {
|
|
|
+ if (is_v_map)
|
|
|
+ {
|
|
|
+ m_isVehicleMap = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
loc_point pt = m_sel_tool->select_solution(vp, lm);
|
|
|
//pt.y = pt.y;
|
|
|
|
|
@@ -146,17 +162,32 @@ void card_location_base::on_location(const std::vector<point>&vp, const std::vec
|
|
|
sid = site_ptr->m_id;
|
|
|
if(pt.m_useless)
|
|
|
{
|
|
|
- if (!is_v_map)
|
|
|
+ if (is_person())
|
|
|
{
|
|
|
- x = tool_other::round(pt.x, 3);
|
|
|
- y = tool_other::round(pt.y, 3);
|
|
|
+ if (!is_v_map)
|
|
|
+ {
|
|
|
+ x = tool_other::round(pt.x, 3);
|
|
|
+ y = tool_other::round(pt.y, 3);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ m_v_point.x = tool_other::round(pt.x, 3);
|
|
|
+ m_v_point.y = tool_other::round(pt.y, 3);
|
|
|
+ log_info("useful loc m_v_point: type=%d, card=%d, site=%d, ct=%d, timestamp=%llu, x=%f, y=%f, speed=%.2f, acc=%.2f", m_type, m_id, sid, m_ct, m_time, m_v_point.x, m_v_point.y, m_speed, lm[0].m_acc);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
+ else if (is_vehicle())
|
|
|
{
|
|
|
- m_v_point.x = tool_other::round(pt.x, 3);
|
|
|
- m_v_point.y = tool_other::round(pt.y, 3);
|
|
|
- log_info("useful loc m_v_point: type=%d, card=%d, site=%d, ct=%d, timestamp=%llu, x=%f, y=%f, speed=%.2f, acc=%.2f", m_type, m_id, sid, m_ct, m_time, m_v_point.x, m_v_point.y, m_speed, lm[0].m_acc);
|
|
|
- return;
|
|
|
+ if (is_v_map)
|
|
|
+ {
|
|
|
+ x = tool_other::round(pt.x, 3);
|
|
|
+ y = tool_other::round(pt.y, 3);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
double acc = lm[0].m_acc;
|