ya_setting.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _YASL_SETTINS_H
  2. #define _YASL_SETTINS_H
  3. #include <time.h>
  4. #include <map>
  5. #include "common_tool.h"
  6. #include "service_position.h"
  7. // 系统设置,,读取DB.dat_setting
  8. struct SSys_setting // system_limit_setting
  9. {
  10. unsigned int over_count_person; // 井下人员超员
  11. unsigned int over_count_vehicle; // 井下车辆超员
  12. unsigned int over_time_person; // 井下人员超时
  13. unsigned int over_time_vehicle; // 井下车辆超时
  14. double over_speed; // 井下车辆超速
  15. // lihongzhen 2017/8/18 考勤偏移时间
  16. int att_starttime_offset_staff;
  17. int att_endtime_offset_staff;
  18. int att_starttime_offset_vehicle;
  19. int att_endtime_offset_vehicle;
  20. uint64_t att_person_thre_hour;
  21. //车辆防追尾配置数据
  22. double rear_end_d;
  23. time_t rear_end_t;
  24. double geofault_warn_dis;
  25. std::string rav_disable;
  26. SSys_setting()
  27. {
  28. init();
  29. }
  30. bool check_rav(uint8_t type,uint32_t id)
  31. {
  32. bool f = false;
  33. std::string cardid=tool_other::type_id_to_str(type,id);
  34. if(rav_disable.find(cardid) != std::string::npos)
  35. f=true;
  36. return f;
  37. }
  38. void init()
  39. {
  40. over_count_person = 1000;
  41. over_count_vehicle = 100;
  42. over_speed = 30;
  43. over_time_person = 36000;
  44. over_time_vehicle = 18000;
  45. att_endtime_offset_staff = 600;
  46. att_endtime_offset_vehicle = 600;
  47. att_starttime_offset_staff = 900;
  48. att_starttime_offset_vehicle = 600;
  49. att_person_thre_hour = 0;
  50. rear_end_d = 0;
  51. rear_end_t = 0;
  52. geofault_warn_dis=50;
  53. }
  54. };
  55. class CYaSetting
  56. {
  57. public:
  58. /*
  59. * 从数据库的dat_setting表初始化系统阈值,
  60. * 包括:井下人员阈值,井下车辆阈值,人员超时阈值,车辆超时阈值,车辆超速阈值
  61. */
  62. static SSys_setting m_sys_setting;
  63. static bool Init_sys_setting();
  64. };
  65. struct ios_service{
  66. static service_position_ptr m_ios_service;
  67. static void start_service_position(const int& port);
  68. };
  69. #endif