#ifndef _YASL_SETTINS_H
#define _YASL_SETTINS_H

#include <time.h>
#include <map>

// 系统设置，，读取DB.dat_setting
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; // 井下车辆超速

	// lihongzhen  2017/8/18 考勤偏移时间
	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;
    SSys_setting()
    {
        init();
    }
    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; 
    }
};

class CYaSetting
{
public:
    /*
    * 从数据库的dat_setting表初始化系统阈值，
    * 包括：井下人员阈值，井下车辆阈值，人员超时阈值，车辆超时阈值，车辆超速阈值
    */
    static SSys_setting m_sys_setting;
    static bool Init_sys_setting();

};

#endif
