Add Socket Support

This commit is contained in:
Grant Terris
2019-11-02 15:43:33 -07:00
parent c6bd616951
commit c6a7588fd7
9 changed files with 115 additions and 35 deletions

31
ImageManager.hpp Normal file
View File

@@ -0,0 +1,31 @@
#ifndef ImageManager_H
#define ImageManager_H
#include <opencv2/core.hpp>
#include <QUdpSocket>
#include "FaultManager.hpp"
#define THROTTLE_AMOUNT 1
class ImageManager
{
public:
bool ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPointer, FaultManager fault_mgr, bool test);
void SendImage(cv::Mat image);
QUdpSocket *socket;
ImageManager() {
socket = new QUdpSocket();
socket->connectToHost(QHostAddress::LocalHost, 40000, QIODevice::ReadWrite);
}
private:
int throttle_count = 1;
};
#endif