ya_setting.h 1.8 KB

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