1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #ifndef DRIVINGFACE_ALARM_H
- #define DRIVINGFACE_ALARM_H
- #include "struct_def.h"
- #include "point.h"
- #include <map>
- using namespace std;
- const int OT_CARD = 9;
- //掘进面靠近预警区域告警
- const int ET_CARD_DRIVINGFACE_WARNING_AREA = 28;
- struct DrivingFaceInfo {
- int vehicle_id; //掘进机ID
- int vehicle_type_id; //设备类型 26-掘进机
- double warning_threshold; //与分站距离超限告警值
- int warning_count; //告警次数
- bool bWarning; //是否报警
- double distance; //距离
- DrivingFaceInfo() {
- vehicle_id = 0;
- vehicle_type_id = 0;
- warning_threshold = 0.0f;
- warning_count = 0;
- bWarning = false;
- distance = 0.0;
- }
- void clean()
- {
- vehicle_id = 0;
- vehicle_type_id = 0;
- warning_threshold = 0.0f;
- warning_count = 0;
- bWarning = false;
- distance = 0.0;
- }
- };
- struct DrivingCard : point{
- int vehicle_card_id;//掘进机对应的卡ID
- int vehicle_id; //掘进机ID
- int card_type; //卡类型1-人卡,2-车卡,4-采煤机,5-掘进机
- int reader_id; //分站ID
- double reader_x; //分站X
- double reader_y; //分站Y
- double map_scale; //比例
- DrivingCard() {
- vehicle_card_id = 0;
- vehicle_id = 0;
- card_type = 0;
- reader_id = 0;
- reader_x = 0.0;
- reader_y = 0.0;
- map_scale = 0.0;
- }
- };
- class DrivingFaceAlarm {
- public:
- void init(int drivingface_id = 0);
- void driving_alarm(DrivingCard &card);
- void set_send_callback(const SendCallBack &cb)
- {
- m_send_callback = move(cb);
- }
- public:
- void init_drivingface_db( int drivingface_id = 0);
- void del_drivingface(int drivingface_id );
- private:
- map<int, DrivingFaceInfo> m_map_drivingface;
- SendCallBack m_send_callback;
- };
- #endif
|