IVA/app/HxTaskDispatch.h

107 lines
2.7 KiB
C
Raw Permalink Normal View History

2023-10-20 23:36:22 +08:00
#ifndef HXTASKDISPATCH_H
#define HXTASKDISPATCH_H
#include <QThread>
#include "HxUtils.h"
#include "MvObjectEventDetect.h"
#include <opencv2/opencv.hpp>
#include <opencv2/freetype.hpp>
2023-10-20 23:48:21 +08:00
#define ALGORITHM_TYPE_ADAS 0
#define ALGORITHM_TYPE_BSD 1
#define ALGORITHM_TYPE_DSM 2
2023-10-20 23:36:22 +08:00
class HxTaskDispatch : public QThread
2023-10-20 23:36:22 +08:00
{
Q_OBJECT
public:
/**
* @brief
*/
static void initialization(void);
/**
* @brief DebugTool监听程序
* @param port
*/
static void listern(uint16_t port);
/**
* @brief
* @param address
*/
static void connect_to_host(QString address, int port);
/**
* @brief alarm_upload_event
* @param type
* @param timestamp
* @param channel
* @param event_type
* @param danger_level
* @param object_info
* @param object_number
* @param face_land_marks
* @param face_land_marks_number
* @param left_line_type
* @param right_line_type
*/
static void alarm_upload_event(int type, QDateTime timestamp, int channel, int event_type, int danger_level, ObjectPara *object_info, int object_number, CalibrationPoint *face_land_marks, int face_land_marks_number, LaneType left_line_type, LaneType right_line_type);
2023-10-20 23:36:22 +08:00
/**
* @brief get_car_info
* @return
2023-10-20 23:36:22 +08:00
*/
static CarInfoInput* get_car_info(void);
2023-10-20 23:36:22 +08:00
/**
* @brief enqueue_upload_file
* @param filename
*/
static void enqueue_upload_file(QString filename);
2023-10-20 23:36:22 +08:00
protected:
void run() override;
private:
void update_heartbeat(void);
2023-10-20 23:36:22 +08:00
void updata_vehiclue_status(QJsonObject object);
void parsing_vehiclue_status(void);
void recording_upload_task(void);
void upload_file_queue_check(void);
2023-10-20 23:36:22 +08:00
void debug_tool_response_event(int type, std::initializer_list<QPair<QString, QJsonValue>> args);
void get_warn_param_config(int type);
void set_warn_param_config(int type, QJsonObject object);
void get_adas_camera_calibration(int type);
void set_adas_camera_calibration(int type, QJsonObject object);
2023-10-20 23:36:22 +08:00
signals:
void data_write_event(QByteArray data);
public slots:
void data_receive_event(QByteArray data);
private:
/* 事件检测配置信息*/
ObjectEventDetectConfig event_detect_config;
/* 心跳发送时间戳 */
QDateTime heartbeat_timestamp;
/* 车辆状态更新时间 */
QDateTime vehicle_status_update_time;
/* 边缘云 Socket (客户端) */
HxSocket* platform;
2023-10-20 23:36:22 +08:00
/* DebugTool Socket (服务端) */
HxSocket* debug_tool;
2023-10-20 23:36:22 +08:00
/* 车辆状态信息 */
CarInfoInput car_info;
};
#endif // HXTASKDISPATCH_H