mine.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #include <memory>
  13. struct card_location_base;
  14. struct mine_tool
  15. {
  16. mine_tool()
  17. {
  18. clear();
  19. }
  20. void clear()
  21. {
  22. m_over_speed_count=0;
  23. m_over_speed_count=0;
  24. m_normal_speed_count=0;
  25. m_status_call=0;
  26. m_is_attendance=false;
  27. m_attendance_start_time=std::chrono::system_clock::time_point(std::chrono::seconds(0));
  28. m_is_overtime=false;
  29. m_overtime=std::chrono::system_clock::time_point(std::chrono::seconds(0));
  30. }
  31. int m_over_speed_count;
  32. int m_normal_speed_count;
  33. ///CALL_NONE(0):没有呼叫,CALL_ING(2):正在呼叫,CALL_SUCCESSED(1):呼叫成功
  34. int m_status_call;
  35. ///考勤状态 0初始状态 1 没在考勤 2 考勤;参看ATTENDANCE_STATUS
  36. bool m_is_attendance;
  37. ///考勤开始时间
  38. std::chrono::system_clock::time_point m_attendance_start_time;
  39. //井下是否超时
  40. bool m_is_overtime;
  41. //井下超时时间
  42. std::chrono::system_clock::time_point m_overtime;
  43. uint64_t get_down_time();
  44. uint64_t get_work_time();
  45. int32_t is_on_duty();
  46. };
  47. #endif // MINE_H