Browse Source

模拟工具推送北翼胶带掘进机脚本,采集宕机。map查找写反了,没查到到数据,则继续运行导致修改了回调函数指针
BUG

chensongchao 6 years ago
parent
commit
3c241e3569
2 changed files with 17 additions and 1 deletions
  1. 8 0
      card_base.cpp
  2. 9 1
      main.cpp

+ 8 - 0
card_base.cpp

@@ -153,6 +153,14 @@ void card_location_base::put_three_rates(card_pos & cp)
 	cp.rec_time=m_time;cp.type=m_type;cp.id=m_id;
 	cp.identifier_id=m_cid;cp.running_stat=m_stat;cp.final_v=m_speed;
 	cp.dpt_id = m_deptid;
+	std::shared_ptr<area_tool> _areatool = get_area_tool();
+	if(nullptr != _areatool && nullptr != _areatool->m_site)
+	{
+		cp.reader_x = _areatool->m_site->x;
+		cp.reader_y = _areatool->m_site->y;
+		cp.reader_id = _areatool->m_site->m_id;
+	}
+
 	log_info("three_rates:type:%d,id:%d,cid:%d",cp.type,cp.id,cp.identifier_id);
 	three_rates::get_instance()->put(cp);
 }

+ 9 - 1
main.cpp

@@ -22,10 +22,17 @@
 #include "ya_setting.h"
 
 config_file config;
-static void handlereader(uint32_t readerid,bool duration,uint32_t t)
+void handlereader(uint32_t readerid,bool duration,uint32_t t)
 {
 
 }
+//三率模块中告警回调
+/*void Handle_ThreeRates_Event_Callback(const int evType, const int evId, uint64_t id
+        , double limitVal, double curVal, bool bFalg)
+{
+
+}*/
+
 struct Init_Setting
 {
     void init()
@@ -82,6 +89,7 @@ struct Init_Setting
 		std_info("three_rates ...................");
 		init_para ip;
 		ip.send_pt = handlereader;
+		ip.driving_face_alarm = nullptr;//Handle_ThreeRates_Event_Callback;
 		three_rates::get_instance()->init(ip,dbs);
 		three_rates::get_instance()->start();
 	}