12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #ifndef _YASL_SETTINS_H
- #define _YASL_SETTINS_H
- #include <time.h>
- #include <map>
- #include <boost/algorithm/string/split.hpp>
- #include <boost/algorithm/string/classification.hpp>
- #include "common_tool.h"
- #include "service_position.h"
- struct SSys_setting // system_limit_setting
- {
- unsigned int over_count_person;
- unsigned int over_count_vehicle;
- unsigned int over_time_person;
- unsigned int over_time_vehicle;
- double over_speed;
-
- int att_starttime_offset_staff;
- int att_endtime_offset_staff;
- int att_starttime_offset_vehicle;
- int att_endtime_offset_vehicle;
- uint64_t att_person_thre_hour;
-
- double rear_end_d;
- time_t rear_end_t;
- double geofault_warn_dis;
- std::string rav_disable;
- std::map<int, float> mp_anti_collision;
- SSys_setting()
- {
- init();
- }
- bool check_rav(uint8_t type,uint32_t id)
- {
- bool f = false;
- std::string cardid=tool_other::type_id_to_str(type,id);
- if(rav_disable.find(cardid) != std::string::npos)
- f=true;
- return f;
- }
- void init()
- {
- over_count_person = 1000;
- over_count_vehicle = 100;
- over_speed = 30;
- over_time_person = 36000;
- over_time_vehicle = 18000;
- att_endtime_offset_staff = 600;
- att_endtime_offset_vehicle = 600;
- att_starttime_offset_staff = 900;
- att_starttime_offset_vehicle = 600;
- att_person_thre_hour = 0;
- rear_end_d = 0;
- rear_end_t = 0;
- geofault_warn_dis=50;
- }
- void init_anti_coll_value(const std::string& ctx)
- {
- std::string c = ctx;
- std::vector<std::string> vt;
- boost::split(vt, c, boost::is_any_of(","));
- for(size_t i = 0;i < vt.size(); ++i)
- {
- mp_anti_collision.insert(std::make_pair(i, atof(vt[i].c_str())));
- }
- }
- bool del_anti_coll_value()
- {
- mp_anti_collision.clear();
- return mp_anti_collision.empty();
- }
- };
- class CYaSetting
- {
- public:
-
- static SSys_setting m_sys_setting;
- static bool Init_sys_setting();
- };
- struct ios_service{
- static service_position_ptr m_ios_service;
- static void start_service_position(const int& port);
- };
- #endif
|