mine.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef MINE_H
  2. #define MINE_H
  3. #include <unordered_map>
  4. #include <log.h>
  5. #include <chrono>
  6. #include "common.h"
  7. #include <memory>
  8. struct card_location_base;
  9. struct mine_tool
  10. {
  11. mine_tool()
  12. {
  13. clear();
  14. }
  15. void clear()
  16. {
  17. m_over_speed_count=0;
  18. m_over_speed_count=0;
  19. m_normal_speed_count=0;
  20. m_status_call=0;
  21. m_is_attendance=false;
  22. m_attendance_start_time = std::chrono::system_clock::time_point(std::chrono::seconds(0));
  23. m_is_overtime = false;
  24. m_overtime=std::chrono::system_clock::time_point(std::chrono::seconds(0));
  25. }
  26. int m_over_speed_count;
  27. int m_normal_speed_count;
  28. ///CALL_NONE(0):没有呼叫,CALL_ING(2):正在呼叫,CALL_SUCCESSED(1):呼叫成功
  29. int m_status_call;
  30. ///考勤状态 0初始状态 1 没在考勤 2 考勤;参看ATTENDANCE_STATUS
  31. bool m_is_attendance;
  32. ///考勤开始时间
  33. std::chrono::system_clock::time_point m_attendance_start_time;
  34. //井下是否超时
  35. bool m_is_overtime;
  36. //井下超时时间
  37. std::chrono::system_clock::time_point m_overtime;
  38. uint64_t get_down_time();
  39. uint64_t get_work_time();
  40. int32_t is_on_duty();
  41. };
  42. #endif // MINE_H