You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.0 KiB
C

1 year ago
#ifndef HOTCAMERAMODULE_H
#define HOTCAMERAMODULE_H
#include <QObject>
#include <QByteArray>
#include <QNetworkAccessManager>
struct HotCameraPara
{
QString IP_Adress;
int month;
int week;
int day;
int start_hour;
int start_minute;
int end_hour;
int end_minute;
int reflectivetemperature ;
float emissivity ;
int distant ;
int alert ;
int alarm ;
int alarm_time;
uint32_t nominal_capacity;
uint32_t calculated_capacity;
};
class MyNetManager;
class QTimer;
class HotCameraModule : public QObject
{
Q_OBJECT
typedef void (*ModuleNetProcess)();
public:
explicit HotCameraModule(int id, QObject *parent = nullptr);
virtual ~HotCameraModule();
signals:
void sigRunTimeChanged();
public slots:
/**
* @brief
*/
void onSavePicture(QByteArray & d);
/**
* @brief
*/
void onSaveTemperature(QByteArray & d);
/**
* @brief
* @param temp
*/
void onTempAlarm(float temp);
/**
* @brief
*/
void onConnectBrokeAlarm();
private slots:
void appTimerProcess();
private:
//热成像开启或关闭
int id;
bool module_enabled = false;
bool TempAlarmFlag = false;
MyNetManager * net;
HotCameraPara para;
//QString SaveTempPictureFileName;//最近存储的温度图片文件名
//热成像参数初始化
void moduleParaReadFromFile(HotCameraPara *p);
//通知抓图完成
void notifyCapPictureFinished(const QString &pic_name);
QTimer *appTimer;
bool eventParaChangedCheck();
bool eventCapPictureCheck();
bool eventGetTemperatureCheck(); //获取实时温度
bool eventTimeChangeCheck();
bool eventConnectTimeCheck();
bool eventConnectBrokeAlarmCheck();
bool eventConnectSwitch();
void moduleConnect();
void modleDisConnect();
bool removeTempAlarmFile();
};
#endif // HOTCAMERAMODULE_H