12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef TRM_DRIVINGFACE_MODULE_H
- #define TRM_DRIVINGFACE_MODULE_H
- #include <mutex>
- #include <memory>
- #include <unordered_map>
- #include <time.h>
- #include "db_api/CDBSingletonDefine.h"
- #include "trm_drivingface.h"
- #include "struct_def.h"
- #include "tools.hpp"
- #include "trm_reader_info.h"
- struct trm_drivingface_module{
- public:
- trm_drivingface_module():m_restart(false){}
- public:
- int init_all(bool status);
- inline void set_restart(const bool status){m_restart = status;}
- inline bool get_restart(){return m_restart;}
- int init_reader();
- int init_drivingface_card(const std::string & sz_drivingface_id = "-1");
- //掘进面偏移数据
- int init_drivingface_ref_points(const std::string & sz_drivingface_id = "-1");
- int init_drivingface_nearest_info(std::shared_ptr<drivingface_card> pCard);
- public:
- int deal_drivingface_service(std::shared_ptr<drivingface_card> pCard, std::shared_ptr<card_pos> p_tcp_card);
- int deal_drivingface_trm(std::shared_ptr<drivingface_card> pCard);
- int deal_drivingface_regular_cycle(std::shared_ptr<drivingface_card> pCard, const point& p); //正常正规循环率处理逻辑
- int deal_drivingface_real_distance(std::shared_ptr<drivingface_card> pCard, const point& p); //正常计算掘进机排数信息处理逻辑
- int deal_drivingface_regular_cycle(); //超时正规循环率处理逻辑
- int deal_drivingface_real_distance(); //超时计算掘进机排数信息处理逻辑
- int save_drivingface_regular_cycle(std::shared_ptr<drivingface_card> pCard, const point& p);//保存掘进排数信息 //写库
- double get_drivingface_schedule_value(const uint64_t& id,const uint8_t type); //查询数据库获得排数信息
- /* 平滑掘进机进尺的距离信息
- * @param value:距离
- * */
- void smooth_row_spacing(double& value,const double& sv);
- public:
- std::shared_ptr<drivingface_card> get_drivingfase_card(std::string card_id);
- std::shared_ptr<drivingface_card> get_drivingfase_card(uint64_t drivingface_id);
- std::shared_ptr<map_info> get_map_info(int map_id);
- //移除掘进面
- void remove_drivingface(int drivingface_id );
- public:
- //掘进机
- typedef std::unordered_map<std::string,std::shared_ptr<drivingface_card>> MAP_DRIVINGFACE_CARD;
- MAP_DRIVINGFACE_CARD mp_drivingface_card_list;
- SimulateReaderMap mp_simulate_reader_list;
- private:
- bool m_restart;
- };
- #endif
|