|
@@ -11,6 +11,7 @@
|
|
#include "../DataManager/DataPackage.h"
|
|
#include "../DataManager/DataPackage.h"
|
|
#include <opencv4/opencv2/opencv.hpp>
|
|
#include <opencv4/opencv2/opencv.hpp>
|
|
#include <opencv4/opencv2/imgcodecs.hpp>
|
|
#include <opencv4/opencv2/imgcodecs.hpp>
|
|
|
|
+#include "../ImageTest/ImageTest.h"
|
|
|
|
|
|
struct timeval pre_frame_time;
|
|
struct timeval pre_frame_time;
|
|
|
|
|
|
@@ -33,7 +34,7 @@ void cbSaveToLocal(uvc_frame_t *frame, void *ptr)
|
|
// static MemoryPool<DataPackage> dataPool(BUFFER_SIZE, 3840, 2160);
|
|
// static MemoryPool<DataPackage> dataPool(BUFFER_SIZE, 3840, 2160);
|
|
std::shared_ptr<DataPipe<DataPackage>> pipe;
|
|
std::shared_ptr<DataPipe<DataPackage>> pipe;
|
|
|
|
|
|
- // std::fstream readImage("./uav1.jpg", std::ios::binary | std::ios::in);
|
|
|
|
|
|
+ // std::fstream readImage("./auv.jpg", std::ios::binary | std::ios::in);
|
|
// if (!readImage)
|
|
// if (!readImage)
|
|
// {
|
|
// {
|
|
// std::cerr << "不能打开文件 example.bin" << std::endl;
|
|
// std::cerr << "不能打开文件 example.bin" << std::endl;
|
|
@@ -41,6 +42,9 @@ void cbSaveToLocal(uvc_frame_t *frame, void *ptr)
|
|
// readImage.seekg(0, std::ios::end);
|
|
// readImage.seekg(0, std::ios::end);
|
|
// std::streamsize fileSize = readImage.tellg();
|
|
// std::streamsize fileSize = readImage.tellg();
|
|
// readImage.seekg(0, std::ios::beg);
|
|
// readImage.seekg(0, std::ios::beg);
|
|
|
|
+ // unsigned char *buffer = new unsigned char[fileSize];
|
|
|
|
+ // readImage.read((char *)buffer, fileSize);
|
|
|
|
+ // readImage.close();
|
|
|
|
|
|
switch (frame->frame_format)
|
|
switch (frame->frame_format)
|
|
{
|
|
{
|
|
@@ -52,12 +56,17 @@ void cbSaveToLocal(uvc_frame_t *frame, void *ptr)
|
|
break;
|
|
break;
|
|
case UVC_COLOR_FORMAT_MJPEG:
|
|
case UVC_COLOR_FORMAT_MJPEG:
|
|
|
|
|
|
- if (!g_gpioExplorer->getFailingStatus(index))
|
|
|
|
|
|
+ // if (!g_gpioExplorer->getFailingStatus(index))
|
|
|
|
+ // {
|
|
|
|
+ // // std::cout << "Pass this wave" << std::endl;
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ // g_gpioExplorer->resetFailingStatus(index);
|
|
|
|
+
|
|
|
|
+ if(!UsbTest::SimulateTrigger::getInstance().isTriggering(index))
|
|
{
|
|
{
|
|
- // std::cout << "Pass this wave" << std::endl;
|
|
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- g_gpioExplorer->resetFailingStatus(index);
|
|
|
|
|
|
|
|
if (jpeg_count[index] / 23 >= 1)
|
|
if (jpeg_count[index] / 23 >= 1)
|
|
jpeg_group[index]++;
|
|
jpeg_group[index]++;
|
|
@@ -76,6 +85,9 @@ void cbSaveToLocal(uvc_frame_t *frame, void *ptr)
|
|
dataPackage->nCameraID = index;
|
|
dataPackage->nCameraID = index;
|
|
dataPackage->dDegree = jpeg_count[index]++;
|
|
dataPackage->dDegree = jpeg_count[index]++;
|
|
|
|
|
|
|
|
+ //std::string logMessage = "UVC Frame Received: Device " + std::to_string(index) + " UVC Received: Degree: " + std::to_string(jpeg_count[index] - 1) + UsbTest::GlobalResolutionTimer::getInstance().pressStopWatchString();
|
|
|
|
+ //UsbTest::TimeRecorder::getInstance().recordTime(logMessage);
|
|
|
|
+
|
|
DataManager::getInstance().pushData<DataPackage>("uvc" + std::to_string(index), dataPackage);
|
|
DataManager::getInstance().pushData<DataPackage>("uvc" + std::to_string(index), dataPackage);
|
|
|
|
|
|
// fp = fopen("./Ouput4k.jpg", "w");
|
|
// fp = fopen("./Ouput4k.jpg", "w");
|