From 1a16b19acb23a4f28bafd01f3ed80fb225a96c3e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 30 九月 2022 18:04:12 +0800 Subject: [PATCH] 'bug修复' --- ConsoleApplication/L2DataCapture.cpp | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ConsoleApplication/L2DataCapture.cpp b/ConsoleApplication/L2DataCapture.cpp index 50ee635..ad033d5 100644 --- a/ConsoleApplication/L2DataCapture.cpp +++ b/ConsoleApplication/L2DataCapture.cpp @@ -48,9 +48,11 @@ string code = gpCodes[index]; try { clock_t start = clock(); - list<TradeData> resultList = captureLevel2TradeData(CaptureUtil::capture(index, CAPTURE_TYPE_L2), index); - data_callback(index, code, resultList, context); - cout << "时间消耗:" << clock() - start << endl; + cv::Mat mat = CaptureUtil::capture(index, CAPTURE_TYPE_L2); + list<TradeData> resultList = captureLevel2TradeData(mat, index); + long processTime = clock() - start; + data_callback(index, code, start , processTime, resultList, context); + cout << "时间消耗:" << processTime << endl; } catch (...) { @@ -80,11 +82,9 @@ } void L2DataCapture::setGPCode(int index, string code) { - int length = sizeof(gpCodes) / sizeof(gpCodes[0]); - if (length <= index) { + if (THS_FRAME_COUNT <= index) { return; } - gpCodes[index] = code; } @@ -198,7 +198,7 @@ list<TradeData> resultList= captureLevel2TradeData(openCLExcuter[identify], oimg, identify); - std::cout << "-------L2行情识别结束任务: threadid-" << std::this_thread::get_id() << " 序号:" << identify << " 耗时:" << clock() - starttime <<" 数据量:"<< resultList.size() << endl; + std::cout << "-------L2行情识别结束任务: threadid-" << std::this_thread::get_id() << " 序号:" << identify << " CODE:"<< gpCodes[identify] << " 耗时:" << clock() - starttime <<" 数据量:"<< resultList.size() << endl; return resultList; } -- Gitblit v1.8.0