123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #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;
- int light_group_count;
-
- bool m_enable_anti_coll;
- std::map<int, float> mp_anti_collision;
- int site_no_position_time;
- 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;
- rav_disable = "";
- light_group_count = 1;
- m_enable_anti_coll = false;
- mp_anti_collision.erase(mp_anti_collision.begin(), mp_anti_collision.end());
- site_no_position_time = 60;
- }
- 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
|