mine.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef MINE_H
  2. #define MINE_H
  3. /**
  4. * @brief 矿井里相关的业务
  5. * @author 戴月腾
  6. * @date 2018-09-24
  7. */
  8. #include <unordered_map>
  9. #include <log.h>
  10. #include <chrono>
  11. #include "common.h"
  12. struct mine_tool
  13. {
  14. mine_tool():
  15. m_over_speed_count(0)
  16. ,m_normal_speed_count(0)
  17. ,m_status_call(0)
  18. ,m_stat_attendance(AS_INIT)
  19. ,m_attendance_start_time(std::chrono::seconds(0))
  20. {
  21. }
  22. int m_over_speed_count;
  23. int m_normal_speed_count;
  24. ///CALL_NONE(0):没有呼叫,CALL_ING(2):正在呼叫,CALL_SUCCESSED(1):呼叫成功
  25. int m_status_call;
  26. ///考勤状态 0初始状态 1 没在考勤 2 考勤;参看ATTENDANCE_STATUS
  27. int m_stat_attendance;
  28. ///考勤开始时间
  29. std::chrono::system_clock::time_point m_attendance_start_time;
  30. void on_point(uint32_t card_id, int32_t type, int vehicle_category_id);
  31. uint64_t get_down_time();
  32. uint64_t get_work_time();
  33. int32_t is_on_duty();
  34. bool is_attendance()
  35. {
  36. return AS_ATTENDANCE == m_stat_attendance;
  37. }
  38. };
  39. #endif // MINE_H