| | |
| | | } |
| | | |
| | | cv::Mat CaptureUtil::capture(int index, CaptureContentType type) { |
| | | |
| | | cv::Mat cap = capture(getHWND(index, type)); |
| | | return cap; |
| | | } |
| | | |
| | | |
| | | cv::Mat CaptureUtil::capture(HWND hwnd) { |
| | | clock_t starttime = clock(); |
| | | cv::Mat cap = _wss::screen_shot_by_window(hwnd); |
| | | std::cout << "截图耗时: threadid-" << std::this_thread::get_id() << " 耗时:" << clock() - starttime << endl; |
| | | return cap; |
| | | } |
| | |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
| | | <LinkIncremental>true</LinkIncremental> |
| | | <IncludePath>D:\opencv\build\include\opencv2;D:\opencv\build\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include;$(IncludePath)</IncludePath> |
| | | <LibraryPath>D:\opencv\build\x64\vc15\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\lib\x64;$(LibraryPath)</LibraryPath> |
| | | <LibraryPath>D:\opencv\build\x64\vc15\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\lib\x64;D:\Program Files (x86)\OCL_SDK_Light\lib\x86_64;$(LibraryPath)</LibraryPath> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
| | | <LinkIncremental>false</LinkIncremental> |
| | |
| | | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
| | | <ClCompile> |
| | | <WarningLevel>Level3</WarningLevel> |
| | | <SDLCheck>true</SDLCheck> |
| | | <SDLCheck>false</SDLCheck> |
| | | <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| | | <ConformanceMode>true</ConformanceMode> |
| | | <AdditionalIncludeDirectories>D:\Program Files (x86)\OCL_SDK_Light\include</AdditionalIncludeDirectories> |
| | | </ClCompile> |
| | | <Link> |
| | | <SubSystem>Console</SubSystem> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <None Include="kernel.cl" /> |
| | | <None Include="kernel_test.cl" /> |
| | | <None Include="packages.config" /> |
| | | <None Include="test.cl" /> |
| | | </ItemGroup> |
| | | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
| | | <ImportGroup Label="ExtensionTargets"> |
| | | <Import Project="..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets" Condition="Exists('..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets')" /> |
| | | <Import Project="..\packages\pthreads.2.9.1.4\build\native\pthreads.targets" Condition="Exists('..\packages\pthreads.2.9.1.4\build\native\pthreads.targets')" /> |
| | | <Import Project="..\packages\log4cpp.1.1.3.3\build\log4cpp.targets" Condition="Exists('..\packages\log4cpp.1.1.3.3\build\log4cpp.targets')" /> |
| | | </ImportGroup> |
| | | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
| | | <PropertyGroup> |
| | |
| | | </PropertyGroup> |
| | | <Error Condition="!Exists('..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets'))" /> |
| | | <Error Condition="!Exists('..\packages\pthreads.2.9.1.4\build\native\pthreads.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\pthreads.2.9.1.4\build\native\pthreads.targets'))" /> |
| | | <Error Condition="!Exists('..\packages\log4cpp.1.1.3.3\build\log4cpp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\log4cpp.1.1.3.3\build\log4cpp.targets'))" /> |
| | | </Target> |
| | | </Project> |
| | |
| | | <Filter>源文件</Filter> |
| | | </None> |
| | | <None Include="packages.config" /> |
| | | <None Include="test.cl"> |
| | | <Filter>源文件</Filter> |
| | | </None> |
| | | <None Include="kernel_test.cl"> |
| | | <Filter>源文件</Filter> |
| | | </None> |
| | | </ItemGroup> |
| | | </Project> |
| | |
| | | #include "ImgUtil.h" |
| | | #include <io.h> |
| | | |
| | | NumberData ImgUtil::NUMS_LEVEL2[10]; |
| | | NumberData ImgUtil::NUMS_GP_CODE[10]; |
| | |
| | | //LEVE2数字初始化 |
| | | for (int i = 0;i < 10;i++) { |
| | | std::string sdir = "C:\\Users\\Administrator\\Desktop\\ocr\\number\\"; |
| | | if (_access(sdir.c_str(), 0)) { |
| | | sdir = "sample\\number\\"; |
| | | } |
| | | |
| | | |
| | | std::string path = sdir.append(std::to_string(i)).append(".jpg"); |
| | | NumberData data = NumberData(); |
| | | data.data = formatNumLevel2(cv::imread(path.c_str(), cv::IMREAD_GRAYSCALE)); |
| | |
| | | |
| | | for (int i = 0;i < 10;i++) { |
| | | std::string sdir = "C:\\Users\\Administrator\\Desktop\\ocr\\number_2\\"; |
| | | if (_access(sdir.c_str(), 0)) { |
| | | sdir = "sample\\number_2\\"; |
| | | } |
| | | |
| | | std::string path = sdir.append(std::to_string(i)).append(".jpg"); |
| | | NumberData data = NumberData(); |
| | | data.data = formatNumGPCode(cv::imread(path.c_str(), cv::IMREAD_GRAYSCALE)); |
| | |
| | | #include "THSActionUtil.h" |
| | | #include <thread> |
| | | bool L2DataCapture::inited; |
| | | OpenCLExcuter* L2DataCapture::openCLExcuter[THS_FRAME_COUNT]; |
| | | TradeQueueCapture* L2DataCapture::tradeQueueCapture[THS_FRAME_COUNT]; |
| | | bool L2DataCapture::tradeTimeCapture; |
| | | |
| | | |
| | | OpenCLExcuter* L2DataCapture::openCLExcuter[THS_FRAME_COUNT]; |
| | | TradeQueueCapture* L2DataCapture::tradeQueueCapture[THS_FRAME_COUNT]; |
| | | |
| | | |
| | | //是否正在执行 |
| | | bool L2DataCapture::running; |
| | | bool L2DataCapture::runnings[THS_FRAME_COUNT]; |
| | | clock_t L2DataCapture::latest_running_times[THS_FRAME_COUNT]; |
| | | bool L2DataCapture::running; |
| | | bool L2DataCapture::runnings[THS_FRAME_COUNT]; |
| | | clock_t L2DataCapture::latest_running_times[THS_FRAME_COUNT]; |
| | | |
| | | CallbackFun L2DataCapture::data_callback; |
| | | CallbackFun L2DataCapture::data_callback; |
| | | |
| | | CallbackFun_Trade_Queue L2DataCapture::trade_queue_data_callback; |
| | | CallbackFun_Trade_Queue L2DataCapture::trade_queue_data_callback; |
| | | |
| | | string L2DataCapture::gpCodes[THS_FRAME_COUNT]; |
| | | string L2DataCapture::gpCodes[THS_FRAME_COUNT]; |
| | | |
| | | void* L2DataCapture::context; |
| | | void* L2DataCapture::context; |
| | | |
| | | //将当前时间换算成秒 |
| | | int getNowSecondTime() { |
| | | time_t timep; |
| | | time(&timep); |
| | | char tmp_h[64]; |
| | | strftime(tmp_h, sizeof(tmp_h), "%H", localtime(&timep)); |
| | | char tmp_m[64]; |
| | | strftime(tmp_m, sizeof(tmp_m), "%M", localtime(&timep)); |
| | | char tmp_s[64]; |
| | | strftime(tmp_s, sizeof(tmp_s), "%S", localtime(&timep)); |
| | | return stoi(string(tmp_h)) * 3600 + stoi(string(tmp_m)) * 60 + stoi(string(tmp_s)); |
| | | } |
| | | |
| | | //运行 |
| | | void L2DataCapture::_run(int index) |
| | | { |
| | | while (true) { |
| | | if (running && runnings[index]&& gpCodes[index].length()>0) { |
| | | |
| | | if (tradeTimeCapture) { |
| | | int time = getNowSecondTime(); |
| | | //9:20-11:31 12:59-15:01 |
| | | bool in = false; |
| | | if ((time >= 9 * 3600 + 20 * 60 && time <= 11 * 3600 + 31 * 60) || (time >= 12 * 3600 + 59 * 60 && time <= 15 * 3600 + 1 * 60)) { |
| | | in = true; |
| | | } |
| | | if (!in) { |
| | | Sleep(2); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | if (running && runnings[index] && gpCodes[index].length() > 0) { |
| | | latest_running_times[index] = clock(); |
| | | //识别数据 |
| | | string code = gpCodes[index]; |
| | |
| | | data_callback(index, code, resultList, context); |
| | | } |
| | | catch (...) { |
| | | |
| | | |
| | | } |
| | | } |
| | | Sleep(2); |
| | |
| | | //识别数据 |
| | | string code = gpCodes[index]; |
| | | try { |
| | | list<int> numList= tradeQueueCapture[index]->recognition(CaptureUtil::getHWND(index,CAPTURE_TYPE_TRADE_QUEUE)); |
| | | list<int> numList = tradeQueueCapture[index]->recognition(CaptureUtil::getHWND(index, CAPTURE_TYPE_TRADE_QUEUE)); |
| | | trade_queue_data_callback(index, code, numList, context); |
| | | } |
| | | catch (...) { |
| | |
| | | } |
| | | |
| | | string L2DataCapture::getGPCode(int index) { |
| | | return gpCodes[index]; |
| | | return gpCodes[index]; |
| | | } |
| | | |
| | | void L2DataCapture::setTradeTimeCapture(bool enable) |
| | | { |
| | | tradeTimeCapture = enable; |
| | | } |
| | | |
| | | static string getGPCode(int index); |
| | |
| | | int length = sizeof(runnings) / sizeof(runnings[0]); |
| | | for (int i = 0;i < length;i++) { |
| | | runnings[i] = false; |
| | | thread rt(&(L2DataCapture::_run),i); |
| | | thread rt(&(L2DataCapture::_run), i); |
| | | rt.detach(); |
| | | |
| | | //thread rt_trade_queue(&(L2DataCapture::_run_trade_queue), i); |
| | |
| | | |
| | | uchar* imgData = (uchar*)malloc(sizeof(uchar) * oimg.rows * oimg.cols); |
| | | // |
| | | if (oimg.channels() == 3) |
| | | { |
| | | openCLExcuter[identify]->rgb2Gray(oimg.data, oimg.cols, oimg.rows, imgData); |
| | | if (oimg.channels() == 1) { |
| | | //黑白图片 |
| | | img.data = oimg.data; |
| | | } |
| | | else { |
| | | openCLExcuter[identify]->rgba2Gray(oimg.data, oimg.cols, oimg.rows, imgData); |
| | | } |
| | | img.data = imgData; |
| | | oimg.release(); |
| | | if (oimg.channels() == 3) |
| | | { |
| | | openCLExcuter[identify]->rgb2Gray(oimg.data, oimg.cols, oimg.rows, imgData); |
| | | } |
| | | else { |
| | | openCLExcuter[identify]->rgba2Gray(oimg.data, oimg.cols, oimg.rows, imgData); |
| | | } |
| | | img.data = imgData; |
| | | oimg.release(); |
| | | clock_t time_2_ = clock(); |
| | | if (identify == 0) |
| | | { |
| | | std::cout << "灰度完成: threadid-" << std::this_thread::get_id() << " 耗时:" << (time_2_ - time_1) << endl; |
| | | |
| | | std::cout <<"通道数:"<<oimg.channels()<<endl; |
| | | |
| | | LogUtil::debug("灰度完成"); |
| | | } |
| | | } |
| | | |
| | | clock_t time_2 = clock(); |
| | | std::cout << "灰度完成: threadid-" << std::this_thread::get_id() << " 耗时:" << (time_2 - time_1) << endl; |
| | | LogUtil::debug("灰度完成"); |
| | | |
| | | //将图像转为1维数组 |
| | | //unsigned char* imgData = img.data; |
| | | |
| | | |
| | | |
| | | |
| | | //图像分割---开始 |
| | |
| | | } |
| | | } |
| | | catch (...) { |
| | | //释放内存 |
| | | free(imgData); |
| | | throw int(ERROR_CODE_DIVIDE_IMG_FAIL); |
| | | } |
| | | //准备数据 |
| | | //一维行图像数据 |
| | | int* rowDataOneLevel = (int*)malloc(sizeof(int) * rowDataList.size() * 4); |
| | | list<int*>::iterator e; |
| | | int index = 0; |
| | |
| | | index++; |
| | | free(indexs); |
| | | } |
| | | |
| | | //一维分块图像数据 |
| | | int* rowSplitDataOneLevel = (int*)malloc(sizeof(int) * rowDataList.size() * 4 * 7); |
| | | openCLExcuter[identify]->splitL2RowData(imgData, img.cols, img.rows, rowDataOneLevel, rowDataList.size(), rowSplitDataOneLevel); |
| | | free(rowDataOneLevel); |
| | |
| | | |
| | | clock_t time_3 = clock(); |
| | | //LogUtil::debug("分隔完成"); |
| | | std::cout << "分隔完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_3 - time_2 << endl; |
| | | if (identify == 0) |
| | | std::cout << "分隔完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_3 - time_2 << "总耗时:" << time_3 - time_1 << endl; |
| | | |
| | | //图像分割---结束 |
| | | //结果初始化 |
| | | list<TradeData> resultList; |
| | | for (int i = 0;i < rowDataList.size();i++) { |
| | | TradeData td = TradeData(); |
| | | resultList.push_back(td); |
| | | } |
| | | |
| | | //------非数字识别开始------- |
| | | //图像识别(除开数字的部分) |
| | | |
| | | int* notNumberResult = (int*)malloc(sizeof(int) * rowDataList.size() * 3); |
| | | openCLExcuter[identify]->recognitionNotNum(img.data, img.cols, img.rows, rowSplitDataOneLevel, 7, rowDataList.size(), notNumberResult); |
| | | |
| | | |
| | | int i = 0; |
| | | for (list<TradeData>::iterator ele = resultList.begin();ele != resultList.end();++ele) { |
| | | switch (notNumberResult[i * 3]) |
| | | { |
| | | case 0: |
| | | (*ele).cancelTimeUnit = TIME_SECOND;break; |
| | | case 1: |
| | | (*ele).cancelTimeUnit = TIME_MINITE;break; |
| | | case 2: |
| | | (*ele).cancelTimeUnit = TIME_HOUR;break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | switch (notNumberResult[i * 3 + 1]) |
| | | { |
| | | case 0: |
| | | (*ele).limitPrice = LIMIT_PRICE_NORMAL;break; |
| | | case 1: |
| | | (*ele).limitPrice = LIMIT_PRICE_UP;break; |
| | | case 2: |
| | | (*ele).limitPrice = LIMIT_PRICE_DOWN;break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | switch (notNumberResult[i * 3 + 2]) |
| | | { |
| | | case OPERATE_BUY: |
| | | (*ele).operateType = OPERATE_BUY; |
| | | break; |
| | | case OPERATE_BUY_CANCEL: |
| | | (*ele).operateType = OPERATE_BUY_CANCEL; |
| | | break; |
| | | case OPERATE_SELL: |
| | | (*ele).operateType = OPERATE_SELL; |
| | | break; |
| | | case OPERATE_SELL_CANCEL: |
| | | (*ele).operateType = OPERATE_SELL_CANCEL; |
| | | break; |
| | | case OPERATE_OPERATE_ERROR: |
| | | (*ele).operateType = OPERATE_OPERATE_ERROR; |
| | | break; |
| | | }; |
| | | |
| | | i++; |
| | | } |
| | | |
| | | free(notNumberResult); |
| | | |
| | | clock_t time_5 = clock(); |
| | | if (identify == 0) |
| | | std::cout << "非数字数据识别完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_5 - time_3 << "总耗时:" << time_5 - time_1 << endl; |
| | | |
| | | |
| | | //------非数字识别结束------- |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //图像识别的数字准备 |
| | | //------数字识别开始--------- |
| | | |
| | | unsigned char* totalNumberData = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * rowDataList.size()) * _NUMBER_L2_WIDTH * 10 * _NUMBER_L2_TOTAL_NUMBER); |
| | | |
| | | |
| | | |
| | | clock_t time_31 = clock(); |
| | | std::cout << "数据准备-图像数据准备: threadid-" << std::this_thread::get_id() << " 耗时:" << time_31 - time_3 << endl; |
| | | if (identify == 0) |
| | | std::cout << "数据准备-图像数据准备: threadid-" << std::this_thread::get_id() << " 耗时:" << time_31 - time_3 << "总耗时:" << time_31 - time_1 << endl; |
| | | |
| | | int* pos = (int*)malloc(sizeof(int) * 4 * 4 * rowDataList.size()); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | start = index * 4 * 4 + 4 * 3; |
| | | start = index * 4 * 4 + 4 * 3; |
| | | pos[start] = rowSplitDataOneLevel[startS + 4 * 5 + 0]; |
| | | pos[start + 1] = rowSplitDataOneLevel[startS + 4 * 5 + 1]; |
| | | pos[start + 2] = rowSplitDataOneLevel[startS + 4 * 5 + 2]; |
| | |
| | | |
| | | |
| | | clock_t time_32 = clock(); |
| | | std::cout << "数据准备-位置数据准备: threadid-" << std::this_thread::get_id() << " 耗时:" << time_32 - time_31 << endl; |
| | | if (identify == 0) |
| | | std::cout << "数据准备-位置数据准备: threadid-" << std::this_thread::get_id() << " 耗时:" << time_32 - time_31 << "总耗时:" << time_32 - time_1 << endl; |
| | | |
| | | unsigned char* zeroData = (unsigned char*)malloc(sizeof(unsigned char) * _NUMBER_L2_WIDTH * _NUMBER_L2_HEIGHT); |
| | | for (int r = 0;r < _NUMBER_L2_HEIGHT;r++) { |
| | |
| | | } |
| | | |
| | | clock_t time_33 = clock(); |
| | | std::cout << "数据准备-0数据准备: threadid-" << std::this_thread::get_id() << " 耗时:" << time_33 - time_32 << endl; |
| | | if (identify == 0) |
| | | std::cout << "数据准备-0数据准备: threadid-" << std::this_thread::get_id() << " 耗时:" << time_33 - time_32 << "总耗时:" << time_33 - time_1 << endl; |
| | | |
| | | openCLExcuter[identify]->splitL2Num(imgData, img.cols, img.rows, pos, 4 * rowDataList.size(), zeroData, _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, _NUMBER_L2_TOTAL_NUMBER, totalNumberData); |
| | | free(zeroData); |
| | | free(pos); |
| | | |
| | | |
| | | |
| | | |
| | | /* |
| | |
| | | |
| | | */ |
| | | clock_t time_34 = clock(); |
| | | std::cout << "数据准备-数字分隔完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_34 - time_33 << endl; |
| | | if (identify == 0) |
| | | std::cout << "数据准备-数字分隔完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_34 - time_33 << "总耗时:" << time_34 - time_1 << endl; |
| | | |
| | | //准备模板数字 |
| | | uchar* templateNums = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * rowDataList.size()) * _NUMBER_L2_WIDTH * 10 * _NUMBER_L2_TOTAL_NUMBER); |
| | | |
| | | openCLExcuter[identify]->createNumberTemplates(rowDataList.size(), _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, _NUMBER_L2_TOTAL_NUMBER, ImgUtil::numsOneLevel_level2 ,templateNums); |
| | | openCLExcuter[identify]->createNumberTemplates(rowDataList.size(), _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, _NUMBER_L2_TOTAL_NUMBER, ImgUtil::numsOneLevel_level2, templateNums); |
| | | |
| | | //ImgUtil::createTemplateNumData(data.size()); |
| | | clock_t time_4 = clock(); |
| | | std::cout << "数据准备-模板数字准备完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_4 - time_34 << endl; |
| | | if (identify == 0) |
| | | std::cout << "数据准备-模板数字准备完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_4 - time_34 << "总耗时:" << time_4 - time_1 << endl; |
| | | |
| | | |
| | | std::cout << "数据准备完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_4 - time_3 << endl; |
| | | |
| | | |
| | | //图像识别(除开数字的部分) |
| | | list<TradeData> resultList; |
| | | |
| | | |
| | | int* notNumberResult = (int*)malloc(sizeof(int)* rowDataList.size()*3); |
| | | openCLExcuter[identify]->recognitionNotNum(img.data,img.cols,img.rows, rowSplitDataOneLevel,7, rowDataList.size(), notNumberResult); |
| | | if (identify == 0) |
| | | std::cout << "数据准备完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_4 - time_3 << "总耗时:" << time_4 - time_1 << endl; |
| | | |
| | | |
| | | |
| | | for (int i = 0;i < rowDataList.size();i++) { |
| | | TradeData td = TradeData(); |
| | | |
| | | switch (notNumberResult[i * 3]) |
| | | { |
| | | case 0: |
| | | td.cancelTimeUnit = TIME_SECOND;break; |
| | | case 1: |
| | | td.cancelTimeUnit = TIME_MINITE;break; |
| | | case 2: |
| | | td.cancelTimeUnit = TIME_HOUR;break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | switch (notNumberResult[i * 3+1]) |
| | | { |
| | | case 0: |
| | | td.limitPrice = LIMIT_PRICE_NORMAL;break; |
| | | case 1: |
| | | td.limitPrice = LIMIT_PRICE_UP;break; |
| | | case 2: |
| | | td.limitPrice = LIMIT_PRICE_DOWN;break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | switch (notNumberResult[i * 3 + 2]) |
| | | { |
| | | case OPERATE_BUY: |
| | | td.operateType = OPERATE_BUY; |
| | | break; |
| | | case OPERATE_BUY_CANCEL: |
| | | td.operateType = OPERATE_BUY_CANCEL; |
| | | break; |
| | | case OPERATE_SELL: |
| | | td.operateType = OPERATE_SELL; |
| | | break; |
| | | case OPERATE_SELL_CANCEL: |
| | | td.operateType = OPERATE_SELL_CANCEL; |
| | | break; |
| | | case OPERATE_OPERATE_ERROR: |
| | | td.operateType = OPERATE_OPERATE_ERROR; |
| | | break; |
| | | }; |
| | | |
| | | resultList.push_back(td); |
| | | } |
| | | |
| | | free(notNumberResult); |
| | | |
| | | /* |
| | | try { |
| | |
| | | throw ERROR_CODE_RECOGNITION_FAIL; |
| | | } |
| | | */ |
| | | |
| | | clock_t time_5 = clock(); |
| | | std::cout << "非数字数据识别完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_5 - time_4 << endl; |
| | | |
| | | |
| | | //数字识别 |
| | | uchar** numberResult = openCLExcuter[identify]->recognition_numbers(totalNumberData, templateNums, rowDataList.size() * _NUMBER_L2_HEIGHT, _NUMBER_L2_WIDTH * 10 * _NUMBER_L2_TOTAL_NUMBER, _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, _NUMBER_L2_TOTAL_NUMBER); |
| | |
| | | |
| | | |
| | | string price = ""; |
| | | price.append(to_string(lineData[6+2])).append(to_string(lineData[7+2])).append(to_string(lineData[8+2])).append(to_string(lineData[9+2])); |
| | | price.append(to_string(lineData[6 + 2])).append(to_string(lineData[7 + 2])).append(to_string(lineData[8 + 2])).append(to_string(lineData[9 + 2])); |
| | | price.append("."); |
| | | price.append(to_string(lineData[10+2])).append(to_string(lineData[11+2])); |
| | | price.append(to_string(lineData[10 + 2])).append(to_string(lineData[11 + 2])); |
| | | |
| | | string num = ""; |
| | | num.append(to_string(lineData[12+2])).append(to_string(lineData[13+2])).append(to_string(lineData[14+2])).append(to_string(lineData[15+2])).append(to_string(lineData[16+2])); |
| | | num.append(to_string(lineData[12 + 2])).append(to_string(lineData[13 + 2])).append(to_string(lineData[14 + 2])).append(to_string(lineData[15 + 2])).append(to_string(lineData[16 + 2])); |
| | | |
| | | |
| | | (*tradeEle).time = time; |
| | |
| | | |
| | | clock_t time_6 = clock(); |
| | | //LogUtil::debug("识别完成"); |
| | | std::cout << "数字识别完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_6 - time_5 << endl; |
| | | if (identify == 0) |
| | | std::cout << "数字识别完成: threadid-" << std::this_thread::get_id() << " 耗时:" << time_6 - time_5 << "总耗时:" << time_6 - time_1 << endl; |
| | | |
| | | //释放内存 |
| | | //img.release(); |
| | |
| | | list<int*>().swap(rowDataList); |
| | | free(rowSplitDataOneLevel); |
| | | |
| | | std::cout << "-------L2行情识别结束任务: threadid-" << std::this_thread::get_id() << " 序号:" << identify << " 耗时:" << clock() - starttime << endl; |
| | | if (identify == 0) |
| | | std::cout << "-------L2行情识别结束任务: threadid-" << std::this_thread::get_id() << " 序号:" << identify << " 耗时:" << clock() - starttime << endl; |
| | | |
| | | return resultList; |
| | | } |
| | | |
| | | //捕获level2的盘口数据 |
| | | list<TradeData> L2DataCapture::captureLevel2TradeData(HWND hwnd, int index) throw(int) { |
| | | clock_t starttime = clock(); |
| | | cv::Mat img = CaptureUtil::capture(hwnd); |
| | | |
| | | |
| | | /* |
| | | string path1 = "E:\\temp\\"; |
| | |
| | | cv::imwrite(path1, img); |
| | | std::map<string, TradeData> map; |
| | | */ |
| | | |
| | | return captureLevel2TradeData(img, index); |
| | | try { |
| | | list<TradeData> resultList = captureLevel2TradeData(img, index); |
| | | return resultList; |
| | | } |
| | | catch (int code) { |
| | | |
| | | } |
| | | list<TradeData> tempList; |
| | | return tempList; |
| | | } |
| | |
| | | static OpenCLExcuter* openCLExcuter[THS_FRAME_COUNT]; |
| | | static TradeQueueCapture* tradeQueueCapture[THS_FRAME_COUNT]; |
| | | |
| | | //是否在交易时间才截图 |
| | | static bool tradeTimeCapture; |
| | | |
| | | static bool inited; |
| | | //是否正在执行 |
| | |
| | | //获取代码 |
| | | static string getGPCode(int index); |
| | | |
| | | //设置交易时间截图上传数据 |
| | | static void setTradeTimeCapture(bool enable); |
| | | |
| | | }; |
| | | |
| | |
| | | #include "OpenCLExcuter.h" |
| | | #include <chrono> |
| | | |
| | | |
| | | |
| | | #define CHECK_ERRORS(ERR) \ |
| | | if(ERR != CL_SUCCESS){ \ |
| | | cerr << "OpenCL error code" << ERR << "file: " << __FILE__ << "line: " << __LINE__ << ".\nExiting..." << endl; \ |
| | | exit(1); \ |
| | | } |
| | | |
| | | int showDeviceInfo() { |
| | | cl_platform_id* platform; |
| | | cl_uint num_platform; |
| | | cl_int err; |
| | | err = clGetPlatformIDs(0, NULL, &num_platform); |
| | | platform = (cl_platform_id*)malloc(sizeof(cl_platform_id) * num_platform); |
| | | err = clGetPlatformIDs(num_platform, platform, NULL); |
| | | for (int i = 0; i < num_platform; i++) { |
| | | printf("\nPlatform %d information\n", i); |
| | | size_t size; |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_NAME, 0, NULL, &size); |
| | | char* PName = (char*)malloc(size); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_NAME, size, PName, NULL); |
| | | printf("CL_PLATFORM_NAME: %s\n", PName); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_VENDOR, 0, NULL, &size); |
| | | char* PVendor = (char*)malloc(size); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_VENDOR, size, PVendor, NULL); |
| | | printf("CL_PLATFORM_VENDOR: %s\n", PVendor); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_VERSION, 0, NULL, &size); |
| | | char* PVersion = (char*)malloc(size); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_VERSION, size, PVersion, NULL); |
| | | printf("CL_PLATFORM_VERSION: %s\n", PVersion); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_PROFILE, 0, NULL, &size); |
| | | char* PProfile = (char*)malloc(size); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_PROFILE, size, PProfile, NULL); |
| | | printf("CL_PLATFORM_PROFILE: %s\n", PProfile); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_EXTENSIONS, 0, NULL, &size); |
| | | char* PExten = (char*)malloc(size); |
| | | err = clGetPlatformInfo(platform[i], CL_PLATFORM_EXTENSIONS, size, PExten, NULL); |
| | | printf("CL_PLATFORM_EXTENSIONS: %s\n", PExten); |
| | | free(PName); |
| | | free(PVendor); |
| | | free(PVersion); |
| | | free(PProfile); |
| | | free(PExten); |
| | | } |
| | | |
| | | return 0; |
| | | |
| | | } |
| | | |
| | | string OpenCLExcuter::rootPath; |
| | | |
| | | void OpenCLExcuter::init() { |
| | | showDeviceInfo(); |
| | | //获取平台 |
| | | error = clGetPlatformIDs(1, &platforms, &num_of_platforms); |
| | | if (error != 0) { |
| | |
| | | //} |
| | | |
| | | |
| | | error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_CPU, 1, &devices, NULL); |
| | | error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_GPU , 1, &devices, NULL); |
| | | if (error != 0) { |
| | | error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_GPU, 1, &devices, NULL); |
| | | error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_CPU, 1, &devices, NULL); |
| | | if (error != 0) { |
| | | throw string("Get device failed!"); |
| | | } |
| | |
| | | throw string("Creat context failed!"); |
| | | } |
| | | //创建程序;注意要用"rb" |
| | | fopen_s(&program_handle, "D:\\workspace\\CPlusTest\\ConsoleApplication\\ConsoleApplication\\kernel.cl", "rb"); |
| | | string kernel_path = ""; |
| | | if (rootPath.length() >0) { |
| | | kernel_path = kernel_path.append(rootPath); |
| | | } |
| | | |
| | | kernel_path.append("kernel.cl"); |
| | | cout <<"kernel_path:"<< kernel_path << endl; |
| | | fopen_s(&program_handle, kernel_path.c_str(), "rb"); |
| | | |
| | | if (program_handle == NULL) { |
| | | throw string("The kernle can not be opened!"); |
| | | } |
| | |
| | | program = clCreateProgramWithSource(context, 1, (const char**)&program_buffer, |
| | | &program_size, &error); |
| | | if (error < 0) { |
| | | throw string("Couldn't create the program!"); |
| | | program = clCreateProgramWithSource(context, 0, (const char**)&program_buffer, |
| | | &program_size, &error); |
| | | if (error < 0) { |
| | | string st = "Couldn't create the program!"; |
| | | st.append(" error:").append(to_string(error)); |
| | | throw st; |
| | | } |
| | | } |
| | | //编译程序 |
| | | error = clBuildProgram(program, 1, &devices, NULL, NULL, NULL); |
| | |
| | | free(program_buffer); |
| | | |
| | | //创建命令队列 |
| | | queue = clCreateCommandQueue(context, devices, CL_QUEUE_PROFILING_ENABLE, &error); |
| | | //queue = clCreateCommandQueue(context, devices, CL_QUEUE_PROFILING_ENABLE, &error); |
| | | queue = clCreateCommandQueueWithProperties(context, devices, 0, &error); |
| | | |
| | | if (error < 0) { |
| | | throw string("Coudn't create the command queue"); |
| | | queue = clCreateCommandQueue(context, devices, CL_QUEUE_PROFILING_ENABLE, &error); |
| | | if (error < 0) { |
| | | throw string("Coudn't create the command queue"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | throw string("Couldn't create kernel!\n"); |
| | | } |
| | | //初始化参数 |
| | | unsigned char* result = (unsigned char*)malloc(sizeof(unsigned char) * resultSize); |
| | | |
| | | |
| | | //创建缓存对象 |
| | | cl_mem memObject1 = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(unsigned char) * inputSize, data, &error); |
| | |
| | | throw string("Error queuing kernel for execution!\n"); |
| | | } |
| | | |
| | | unsigned char* result = (unsigned char*)malloc(sizeof(unsigned char) * resultSize); |
| | | //读取执行结果 |
| | | error = clEnqueueReadBuffer(queue, memObject4, CL_TRUE, 0, resultSize * sizeof(unsigned char), |
| | | result, 0, NULL, NULL); |
| | | if (error != CL_SUCCESS) { |
| | | free(result); |
| | | throw string("Error reading result buffer!\n"); |
| | | } |
| | | /* |
| | |
| | | |
| | | //开始第二阶段的计算 |
| | | int resultSize2 = resultSize / 10; |
| | | unsigned char* result2 = (unsigned char*)malloc(sizeof(unsigned char) * resultSize2); |
| | | |
| | | |
| | | kernel = clCreateKernel(program, "recognition_numbers_2", &error); |
| | | if (kernel == NULL) { |
| | | free(result); |
| | | throw string("Couldn't create kernel!\n"); |
| | | } |
| | | |
| | | cl_mem memObject21 = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(unsigned char) * resultSize, result, &error); |
| | | if (error < 0) { |
| | | free(result); |
| | | throw string("Creat memObject1 failed!\n"); |
| | | } |
| | | |
| | |
| | | error |= clSetKernelArg(kernel, 1, sizeof(cl_mem), &memObject22); |
| | | |
| | | if (error != CL_SUCCESS) { |
| | | free(result); |
| | | throw string("Error setting kernel arguments!\n"); |
| | | } |
| | | size_t globalWorkSize2[1] = { resultSize2 }; |
| | | error = clEnqueueNDRangeKernel(queue, kernel, work_dim, NULL, globalWorkSize2, |
| | | localWorkSize, 0, NULL, NULL); |
| | | if (error != CL_SUCCESS) { |
| | | free(result); |
| | | throw string("Error queuing kernel for execution!\n"); |
| | | } |
| | | |
| | | unsigned char* result2 = (unsigned char*)malloc(sizeof(unsigned char) * resultSize2); |
| | | //读取执行结果 |
| | | error = clEnqueueReadBuffer(queue, memObject22, CL_TRUE, 0, resultSize2 * sizeof(unsigned char), |
| | | result2, 0, NULL, NULL); |
| | | if (error != CL_SUCCESS) { |
| | | free(result); |
| | | free(result2); |
| | | throw string("Error reading result buffer!\n"); |
| | | } |
| | | |
| | |
| | | cl_command_queue queue; |
| | | |
| | | public: |
| | | static string rootPath; |
| | | void init(); |
| | | void destory(); |
| | | |
| | |
| | | #include<stdio.h> |
| | | #include<stdlib.h> |
| | | #include<iostream> |
| | | #include<CL/cl.h> |
| | | #include <chrono> |
| | | #include "OpenCLExcuter.h" |
| | | #include "ImgUtil.h" |
| | | using namespace std; |
| | | void printDevice(); |
| | | uchar* createDemoData(int line); |
| | | uchar* createTemplateData(int line); |
| | | #include <stdio.h> |
| | | #include <stdlib.h> |
| | | #include <CL/cl.h> |
| | | |
| | | int LINE_NUMBER = 10; |
| | | int RE = _NUMBER_L2_TOTAL_NUMBER; |
| | | const int ARRAY_SIZE = 1000; |
| | | /* |
| | | 1. 创建平台 |
| | | 2. 创建设备 |
| | | 3. 根据设备创建上下文 |
| | | */ |
| | | cl_context CreateContext(cl_device_id* device) { |
| | | cl_int errNum; |
| | | cl_uint numPlateforms; |
| | | cl_platform_id firstPlatformId; |
| | | cl_context context = NULL; |
| | | errNum = clGetPlatformIDs(1, &firstPlatformId, &numPlateforms); |
| | | |
| | | |
| | | |
| | | #define CHECK_ERRORS(ERR) \ |
| | | if(ERR != CL_SUCCESS){ \ |
| | | std::cerr << "OpenCL error code" << ERR << "file: " << __FILE__ << "line: " << __LINE__ << ".\nExiting..." << std::endl; \ |
| | | exit(1); \ |
| | | if (errNum != CL_SUCCESS || numPlateforms <= 0) { |
| | | printf("Failed to find any OpenCL platforms.\n"); |
| | | return NULL; |
| | | } |
| | | int main1() { |
| | | //printDevice(); |
| | | //return 1; |
| | | auto starttime = std::chrono::steady_clock::now(); |
| | | errNum = clGetDeviceIDs(firstPlatformId, CL_DEVICE_TYPE_GPU, 1, device, NULL); |
| | | if (errNum != CL_SUCCESS) { |
| | | printf("There is no GPU , trying CPU...\n"); |
| | | errNum = clGetDeviceIDs(firstPlatformId, CL_DEVICE_TYPE_CPU, 1, device, NULL); |
| | | |
| | | cl_int error; |
| | | cl_uint num_of_platforms = 0; |
| | | cl_platform_id platforms; |
| | | } |
| | | if (errNum != CL_SUCCESS) { |
| | | printf("There is NO CPU or GPU\n"); |
| | | return NULL; |
| | | } |
| | | context = clCreateContext(NULL, 1, device, NULL, NULL, &errNum); |
| | | if (errNum != CL_SUCCESS) { |
| | | printf("Create context error\n"); |
| | | return NULL; |
| | | } |
| | | return context; |
| | | } |
| | | /* |
| | | @ 在上下文可用的第一个设备中创建命令队列 |
| | | */ |
| | | |
| | | cl_device_id devices; |
| | | cl_command_queue CreateCommandQueue(cl_context context, cl_device_id device) { |
| | | cl_int errNum; |
| | | cl_command_queue commandQueue = NULL; |
| | | //commandQueue = clCreateCommandQueue(context, device, 0, NULL); |
| | | // OpenCL 2.0 的用法 |
| | | commandQueue = clCreateCommandQueueWithProperties(context, device, 0, NULL); |
| | | if (commandQueue == NULL) { |
| | | printf("Failed to create commandQueue for device 0\n"); |
| | | return NULL; |
| | | } |
| | | return commandQueue; |
| | | } |
| | | |
| | | cl_context context; |
| | | char* ReadKernelSourceFile(const char* filename, size_t* length) { |
| | | FILE* file = NULL; |
| | | size_t sourceLenth; |
| | | char* sourceString; |
| | | int ret; |
| | | fopen_s(&file, filename, "rb"); |
| | | |
| | | FILE* program_handle; |
| | | size_t program_size; |
| | | char* program_buffer; |
| | | if (file == NULL) { |
| | | printf("%s at %d : Can't open %s \n", __FILE__, __LINE__ - 2, filename); |
| | | return NULL; |
| | | } |
| | | //重定位到文件末尾 |
| | | fseek(file, 0, SEEK_END); |
| | | sourceLenth = ftell(file); |
| | | //重定位到文件开头 |
| | | fseek(file, 0, SEEK_SET); |
| | | sourceString = (char*)malloc(sourceLenth + 1); |
| | | sourceString[0] = '\0'; |
| | | ret = fread(sourceString, sourceLenth, 1, file); |
| | | if (ret == 0) { |
| | | printf("%s at %d : Cant't read source %s\n", __FILE__, __LINE__ - 2, filename); |
| | | return NULL; |
| | | } |
| | | fclose(file); |
| | | if (length != 0) { |
| | | *length = sourceLenth; |
| | | } |
| | | sourceString[sourceLenth] = '\0'; |
| | | return sourceString; |
| | | |
| | | |
| | | } |
| | | cl_program CreateProgram(cl_context context, cl_device_id device, const char* filename) { |
| | | cl_int errNum; |
| | | cl_program program; |
| | | //记录大小的数据类型 |
| | | size_t program_length; |
| | | char* const source = ReadKernelSourceFile(filename, &program_length); |
| | | program = clCreateProgramWithSource(context, 1, (const char**)&source, NULL, NULL); |
| | | |
| | | size_t log_size; |
| | | char* program_log; |
| | | |
| | | char kernel_name[] = "createBuffer"; |
| | | cl_kernel kernel; |
| | | |
| | | cl_command_queue queue; |
| | | //获取平台 |
| | | error = clGetPlatformIDs(1, &platforms, &num_of_platforms); |
| | | if (error != 0) { |
| | | printf("Get platform failed!"); |
| | | return -1; |
| | | if (program == NULL) { |
| | | printf("Failed to creae CL program from source.\n"); |
| | | return NULL; |
| | | } |
| | | //获取设备 |
| | | error = clGetDeviceIDs(platforms, CL_DEVICE_TYPE_GPU, 1, &devices, NULL); |
| | | if (error != 0) { |
| | | printf("Get device failed!"); |
| | | return -1; |
| | | errNum = clBuildProgram(program, 0, NULL, NULL, NULL, NULL); |
| | | if (errNum != CL_SUCCESS) { |
| | | char buildLog[16384]; |
| | | clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, sizeof(buildLog), buildLog, NULL); |
| | | printf("Error in kernel : %s \n", buildLog); |
| | | clReleaseProgram(program); |
| | | return NULL; |
| | | } |
| | | return program; |
| | | } |
| | | /* |
| | | @ 创建内存对象 |
| | | */ |
| | | bool CreateMemObjects(cl_context context, cl_mem memObjects[3], float* a, float* b) { |
| | | memObjects[0] = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(float) * ARRAY_SIZE, a, NULL); |
| | | memObjects[1] = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(float) * ARRAY_SIZE, b, NULL); |
| | | memObjects[2] = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(float) * ARRAY_SIZE, NULL, NULL); |
| | | if (memObjects[0] == NULL || memObjects[1] == NULL || memObjects[2] == NULL) { |
| | | printf("Error creating memeory objects.\n"); |
| | | return false; |
| | | |
| | | } |
| | | return true; |
| | | } |
| | | /* |
| | | @ 清楚OpenCL资源 |
| | | */ |
| | | void CleanUp(cl_context context, cl_command_queue commandQueue, cl_program program, cl_kernel kernel, cl_mem memObjects[3]) { |
| | | for (int i = 0; i < 3; i++) { |
| | | if (memObjects[i] != 0) { |
| | | clReleaseMemObject(memObjects[i]); |
| | | } |
| | | } |
| | | |
| | | std::cout << " 获取设备:" << std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - starttime).count() << std::endl; |
| | | |
| | | //创建上下文 |
| | | context = clCreateContext(NULL, 1, &devices, NULL, NULL, &error); |
| | | if (error != 0) { |
| | | printf("Creat context failed!"); |
| | | return -1; |
| | | if (commandQueue != 0) { |
| | | clReleaseCommandQueue(commandQueue); |
| | | } |
| | | std::cout << " 创建上下文:" << std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - starttime).count() << std::endl; |
| | | //创建程序;注意要用"rb" |
| | | fopen_s(&program_handle,"kernel.cl", "rb"); |
| | | if (program_handle == NULL) { |
| | | printf("The kernle can not be opened!"); |
| | | return -1; |
| | | } |
| | | fseek(program_handle, 0, SEEK_END); |
| | | program_size = ftell(program_handle); |
| | | rewind(program_handle); |
| | | |
| | | program_buffer = (char*)malloc(program_size + 1); |
| | | program_buffer[program_size] = '\0'; |
| | | error = fread(program_buffer, sizeof(char), program_size, program_handle); |
| | | if (error == 0) { |
| | | printf("Read kernel failed!"); |
| | | return -1; |
| | | } |
| | | fclose(program_handle); |
| | | program = clCreateProgramWithSource(context, 1, (const char**)&program_buffer, |
| | | &program_size, &error); |
| | | if (error < 0) { |
| | | printf("Couldn't create the program!"); |
| | | return -1; |
| | | } |
| | | //编译程序 |
| | | error = clBuildProgram(program, 1, &devices, NULL, NULL, NULL); |
| | | if (error < 0) { |
| | | //确定日志文件的大小 |
| | | clGetProgramBuildInfo(program, devices, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); |
| | | program_log = (char*)malloc(log_size + 1); |
| | | program_log[log_size] = '\0'; |
| | | //读取日志 |
| | | clGetProgramBuildInfo(program, devices, CL_PROGRAM_BUILD_LOG, |
| | | log_size + 1, program_log, NULL); |
| | | printf("%s\n", program_log); |
| | | free(program_log); |
| | | return -1; |
| | | } |
| | | free(program_buffer); |
| | | |
| | | //创建命令队列 |
| | | queue = clCreateCommandQueue(context, devices, CL_QUEUE_PROFILING_ENABLE, &error); |
| | | if (error < 0) { |
| | | printf("Coudn't create the command queue"); |
| | | return -1; |
| | | } |
| | | //----------程序正文开始--------- |
| | | |
| | | for (int n = 0;n < 100;n++) |
| | | { |
| | | |
| | | auto startexectime = std::chrono::steady_clock::now(); |
| | | |
| | | |
| | | |
| | | //创建内核 |
| | | kernel = clCreateKernel(program, "createBuffer", &error); |
| | | if (kernel == NULL) { |
| | | printf("Couldn't create kernel!\n"); |
| | | return -1; |
| | | } |
| | | //初始化参数 |
| | | const int size = 70000; |
| | | float result[size]; |
| | | float a_in[size]; |
| | | float b_in[size]; |
| | | for (int i = 0; i < size; i++) { |
| | | a_in[i] = i+n; |
| | | b_in[i] = i * 2.0; |
| | | } |
| | | //创建缓存对象 |
| | | cl_mem memObject1 = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, sizeof(float) * size, a_in, &error); |
| | | if (error < 0) { |
| | | printf("Creat memObject1 failed!\n"); |
| | | return -1; |
| | | } |
| | | cl_mem memObject2 = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, |
| | | sizeof(float) * size, b_in, &error); |
| | | if (error < 0) { |
| | | printf("Creat memObject2 failed!\n"); |
| | | return -1; |
| | | } |
| | | cl_mem memObject3 = clCreateBuffer(context, CL_MEM_WRITE_ONLY, |
| | | sizeof(float) * size, NULL, &error); |
| | | if (error < 0) { |
| | | printf("Creat memObject3 failed!\n"); |
| | | return -1; |
| | | } |
| | | //设置内核参数 |
| | | error = clSetKernelArg(kernel, 0, sizeof(cl_mem), &memObject1); |
| | | error |= clSetKernelArg(kernel, 1, sizeof(cl_mem), &memObject2); |
| | | error |= clSetKernelArg(kernel, 2, sizeof(cl_mem), &memObject3); |
| | | if (error != CL_SUCCESS) { |
| | | printf("Error setting kernel arguments!\n"); |
| | | return -1; |
| | | } |
| | | //执行内核 |
| | | size_t globalWorkSize[1] = { size }; |
| | | size_t localWorkSize[1] = { 1 }; |
| | | |
| | | const int work_dim = 2; |
| | | |
| | | error = clEnqueueNDRangeKernel(queue, kernel, work_dim, NULL, globalWorkSize, |
| | | localWorkSize, 0, NULL, NULL); |
| | | if (error != CL_SUCCESS) { |
| | | printf("Error queuing kernel for execution!\n"); |
| | | return -1; |
| | | } |
| | | |
| | | //读取执行结果 |
| | | error = clEnqueueReadBuffer(queue, memObject3, CL_TRUE, 0, size * sizeof(float), |
| | | result, 0, NULL, NULL); |
| | | if (error != CL_SUCCESS) { |
| | | printf("Error reading result buffer!\n"); |
| | | return -1; |
| | | } |
| | | //显示结果 |
| | | for (int i = 0; i < 2; i++) { |
| | | printf("%f ", result[i]); |
| | | } |
| | | |
| | | if (kernel != 0) { |
| | | clReleaseKernel(kernel); |
| | | clReleaseMemObject(memObject1); |
| | | clReleaseMemObject(memObject2); |
| | | clReleaseMemObject(memObject3); |
| | | |
| | | |
| | | std::cout << " 执行结束:" << std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - startexectime).count() << std::endl; |
| | | } |
| | | if (program != 0) { |
| | | clReleaseProgram(program); |
| | | } |
| | | if (context != 0) { |
| | | clReleaseContext(context); |
| | | } |
| | | } |
| | | |
| | | //-------------程序正文结束 |
| | | /*main函数*/ |
| | | int main__(int argc, char** agrv) { |
| | | cl_context context = 0; |
| | | cl_command_queue commandQueue = 0; |
| | | cl_program program = 0; |
| | | cl_device_id device = 0; |
| | | cl_kernel kernel = 0; |
| | | cl_mem memObjects[3] = { 0,0,0 }; |
| | | cl_int errNum; |
| | | //创建OpenCL上下文 |
| | | context = CreateContext(&device); |
| | | if (context == NULL) { |
| | | printf("Failed to create OpenCL context\n"); |
| | | return 1; |
| | | } |
| | | //获得OpenCL设备,并创建命令队列 |
| | | commandQueue = CreateCommandQueue(context, device); |
| | | if (commandQueue == NULL) { |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 1; |
| | | } |
| | | //创建OpenCL程序 |
| | | program = CreateProgram(context, device, "kernel.cl"); |
| | | if (program == NULL) { |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 1; |
| | | } |
| | | kernel = clCreateKernel(program, "vector_add", NULL); |
| | | if (kernel == NULL) { |
| | | printf("Failed to create kernel\n"); |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 1; |
| | | |
| | | } |
| | | //创建OpenCL内存对象 |
| | | float result[ARRAY_SIZE]; |
| | | float a[ARRAY_SIZE]; |
| | | float b[ARRAY_SIZE]; |
| | | for (int i = 0; i < ARRAY_SIZE; i++) { |
| | | a[i] = (float)i; |
| | | b[i] = (float)(i * 2); |
| | | } |
| | | if (!CreateMemObjects(context, memObjects, a, b)) { |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 1; |
| | | } |
| | | //设置内核参数 |
| | | errNum = clSetKernelArg(kernel, 0, sizeof(cl_mem), &memObjects[0]); |
| | | errNum |= clSetKernelArg(kernel, 1, sizeof(cl_mem), &memObjects[1]); |
| | | errNum |= clSetKernelArg(kernel, 2, sizeof(cl_mem), &memObjects[2]); |
| | | |
| | | |
| | | //释放资源 |
| | | clReleaseDevice(devices); |
| | | clReleaseContext(context); |
| | | clReleaseProgram(program); |
| | | clReleaseCommandQueue(queue); |
| | | |
| | | std::cout << " 耗时:" << std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - starttime).count() << std::endl; |
| | | if (errNum != CL_SUCCESS) { |
| | | printf("Error setting kernel arguments.\n"); |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 1; |
| | | } |
| | | size_t globalWorkSize[1] = { ARRAY_SIZE }; |
| | | size_t localWorkSize[1] = { 1 }; |
| | | //执行内核 |
| | | errNum = clEnqueueNDRangeKernel(commandQueue, kernel, 1, NULL, globalWorkSize, localWorkSize, 0, NULL, NULL); |
| | | if (errNum != CL_SUCCESS) { |
| | | printf("Error queueing kernel for execution\n"); |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 1; |
| | | } |
| | | //将计算的结果拷贝到主机上 |
| | | errNum = clEnqueueReadBuffer(commandQueue, memObjects[2], CL_TRUE, 0, ARRAY_SIZE * sizeof(float), result, 0, NULL, NULL); |
| | | if (errNum != CL_SUCCESS) { |
| | | printf("Error reading result buffer.\n"); |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 1; |
| | | } |
| | | for (int i = 0; i < ARRAY_SIZE; i++) { |
| | | printf("i=%d:%f\n", i, result[i]); |
| | | } |
| | | printf("Executed program succesfully\n"); |
| | | CleanUp(context, commandQueue, program, kernel, memObjects); |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | int main3() { |
| | | ImgUtil::init(); |
| | | OpenCLExcuter* op = new OpenCLExcuter(); |
| | | int dataCount = 100; |
| | | |
| | | |
| | | int rows = 8* dataCount; |
| | | int cols = 5 * LINE_NUMBER * RE; |
| | | uchar* b_in = createTemplateData(dataCount); |
| | | uchar* a_in = createDemoData(dataCount); |
| | | |
| | | //printf("输入1: \n"); |
| | | for (int r = 0;r < rows;r++) { |
| | | for (int c = 0;c < cols;c++) { |
| | | // printf("%d ", a_in[r*cols+c]); |
| | | } |
| | | // printf("\n"); |
| | | } |
| | | |
| | | //printf("输入2: \n"); |
| | | for (int r = 0;r < rows;r++) { |
| | | for (int c = 0;c < cols;c++) { |
| | | // printf("%d ", b_in[r * cols + c]); |
| | | } |
| | | //printf("\n"); |
| | | } |
| | | |
| | | /* |
| | | int rows = 10; |
| | | int cols = 10; |
| | | uchar* b_in = (uchar*)malloc(sizeof(uchar*)*400); |
| | | uchar* a_in = (uchar*)malloc(sizeof(uchar*) * 400); |
| | | for (int i = 0;i < 400;i++) { |
| | | b_in[i] = i; |
| | | a_in[i] = i + 1; |
| | | } |
| | | */ |
| | | |
| | | op->init(); |
| | | for (int i = 0;i < 100;i++) |
| | | { |
| | | op->recognition_numbers(a_in, b_in, rows, cols ,_NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, _NUMBER_L2_TOTAL_NUMBER); |
| | | } |
| | | op->destory(); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | uchar* createDemoData(int line) { |
| | | unsigned char* data = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * line) * 5 * LINE_NUMBER * RE); |
| | | int outLineDataCount = 8 * 5 * LINE_NUMBER * RE; |
| | | int inLineDataCount = 5 * LINE_NUMBER * RE; |
| | | for (int l = 0;l < line;l++) |
| | | { |
| | | int outLineCount = outLineDataCount * l; |
| | | for (int re = 0;re < RE;re++) { |
| | | |
| | | |
| | | |
| | | for (int n = 0;n < LINE_NUMBER;n++) |
| | | { |
| | | for (int r = 0;r < 8;r++) { |
| | | int intLineCount = inLineDataCount * r; |
| | | |
| | | for (int c = 0;c < 5;c++) { |
| | | uchar value = ImgUtil::NUMS_LEVEL2[re%10].data.ptr(r)[c]; |
| | | int index = outLineCount; |
| | | index += intLineCount; |
| | | int x = re * LINE_NUMBER * 5 + n * 5 + c; |
| | | index += x; |
| | | data[index] = value > 40 ? 1 : 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | uchar* createTemplateData(int line) { |
| | | unsigned char* data = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * line) * _NUMBER_L2_WIDTH * LINE_NUMBER * RE); |
| | | int outLineDataCount = _NUMBER_L2_HEIGHT * _NUMBER_L2_WIDTH * LINE_NUMBER * RE; |
| | | int inLineDataCount = _NUMBER_L2_WIDTH * LINE_NUMBER * RE; |
| | | for (int l = 0;l < line;l++) |
| | | { |
| | | int outLineCount = outLineDataCount * l; |
| | | for (int re = 0;re < RE;re++) { |
| | | for (int n = 0;n < LINE_NUMBER;n++) |
| | | { |
| | | for (int r = 0;r < _NUMBER_L2_HEIGHT;r++) { |
| | | int intLineCount = inLineDataCount * r; |
| | | |
| | | for (int c = 0;c < _NUMBER_L2_WIDTH;c++) { |
| | | uchar value = ImgUtil::NUMS_LEVEL2[n].data.ptr(r)[c]; |
| | | int index = outLineCount; |
| | | index += intLineCount; |
| | | int x = re * LINE_NUMBER * _NUMBER_L2_WIDTH + n * _NUMBER_L2_WIDTH + c; |
| | | index += x; |
| | | data[index] = value > 40 ? 1 : 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | |
| | | void printDevice() { |
| | | |
| | | cl_int err = CL_SUCCESS; |
| | | |
| | | // 1. 获取当前设备所有支持OpenCL的平台的数量 |
| | | cl_uint num_of_platforms = 0; |
| | | err = clGetPlatformIDs(0, 0, &num_of_platforms); |
| | | CHECK_ERRORS(err); |
| | | |
| | | // 2. 获取当前设备所有支持OpenCL的平台的信息 |
| | | cl_platform_id* platforms = new cl_platform_id[num_of_platforms]; |
| | | err = clGetPlatformIDs(num_of_platforms, platforms, 0); |
| | | CHECK_ERRORS(err); |
| | | |
| | | cl_char platform_names[10][50]; |
| | | // 3. 打印平台信息 |
| | | cout << "平台信息:\n"; |
| | | for (cl_uint i = 0; i < num_of_platforms; i++) |
| | | { |
| | | // 获取平台字符串的长度 |
| | | size_t platform_name_length = 0; |
| | | err = clGetPlatformInfo(platforms[i], CL_PLATFORM_NAME, 0, 0, &platform_name_length); |
| | | CHECK_ERRORS(err); |
| | | |
| | | // 获取平台字符串 |
| | | char* platform_name = new char[platform_name_length]; |
| | | err = clGetPlatformInfo(platforms[i], CL_PLATFORM_NAME, platform_name_length, platform_name, 0); |
| | | CHECK_ERRORS(err); |
| | | |
| | | cout << " [" << i << "] " << platform_name << endl; |
| | | |
| | | // 备份platform name |
| | | if (i < 10) { |
| | | memset(platform_names[i], 0, 50); |
| | | memcpy(platform_names[i], platform_name, platform_name_length); |
| | | } |
| | | |
| | | delete[] platform_name; |
| | | } |
| | | |
| | | // 4. 查询各平台设备数量 |
| | | struct { |
| | | cl_device_type type; |
| | | const char* name; |
| | | cl_uint count; |
| | | }devices[] = { |
| | | {CL_DEVICE_TYPE_GPU, "CL_DEVICE_TYPE_GPU", 0}, // GPU |
| | | {CL_DEVICE_TYPE_CPU, "CL_DEVICE_TYPE_CPU", 0}, // CPU |
| | | {CL_DEVICE_TYPE_ACCELERATOR, "CL_DEVICE_TYPE_ACCELERATOR", 0} // 加速器 |
| | | }; |
| | | |
| | | // 5. 遍历查询各个平台下拥有的设备数量 |
| | | for (cl_int j = 0; j < num_of_platforms; j++) { |
| | | cl_platform_id platform = platforms[j]; |
| | | cout << "\nplatform:" << platform_names[j] << endl; |
| | | |
| | | // 6. 遍历查询GPU、CPU、ACCELERATOR设备的数量 |
| | | for (cl_int i = 0; i < (sizeof(devices) / sizeof(devices[0])); i++) |
| | | { |
| | | err = clGetDeviceIDs(platform, devices[i].type, 0, 0, &devices[i].count); |
| | | if (err == CL_DEVICE_NOT_FOUND) { |
| | | devices[i].count = 0; |
| | | err = CL_SUCCESS; |
| | | } |
| | | CHECK_ERRORS(err); |
| | | |
| | | cout << "\tdevices:" << devices[i].name |
| | | << "\tcount:" << devices[i].count; |
| | | |
| | | if (devices[i].count != 0) { |
| | | // 7. 遍历查询GPU、CPU、ACCELERATOR 所有设备的信息 |
| | | cl_device_id* device = new cl_device_id[devices[i].count]; |
| | | err = clGetDeviceIDs(platform, devices[i].type, devices[i].count, device, 0); |
| | | |
| | | cout << "\t\tdevice name:"; |
| | | for (cl_int k = 0; k < devices[i].count; k++) |
| | | { |
| | | // 8. 获取和打印各个设备的name |
| | | size_t length = 0; |
| | | cl_device_id each_device = device[k]; |
| | | err = clGetDeviceInfo(each_device, CL_DEVICE_NAME, 0, 0, &length); |
| | | CHECK_ERRORS(err); |
| | | |
| | | char* value = new char[length]; |
| | | err = clGetDeviceInfo(each_device, CL_DEVICE_NAME, length, value, 0); |
| | | CHECK_ERRORS(err); |
| | | cout << value << " "; |
| | | |
| | | // 9. 获取和打印各个设备的version |
| | | err = clGetDeviceInfo(each_device, CL_DEVICE_VERSION, 0, 0, &length); |
| | | CHECK_ERRORS(err); |
| | | |
| | | char* version = new char[length]; |
| | | err = clGetDeviceInfo(each_device, CL_DEVICE_VERSION, length, version, 0); |
| | | CHECK_ERRORS(err); |
| | | cout << version << " "; |
| | | |
| | | delete[] value; |
| | | delete[] version; |
| | | } |
| | | |
| | | delete[] device; |
| | | } |
| | | cout << endl; |
| | | } |
| | | } |
| | | |
| | | delete[] platforms; |
| | | } |
| | |
| | | #include <opencv2/highgui.hpp> |
| | | #include <opencv2/core.hpp> |
| | | #include <opencv2/imgcodecs.hpp> |
| | | #include <io.h> |
| | | |
| | | using namespace std; |
| | | |
| | |
| | | numSimples.clear(); |
| | | for (int i = 0;i < 10;i++) { |
| | | std::string sdir = "C:\\Users\\Administrator\\Desktop\\ocr\\number\\"; |
| | | if (_access(sdir.c_str(), 0)) { |
| | | sdir = "sample\\number\\"; |
| | | } |
| | | |
| | | std::string path = sdir.append(std::to_string(i)).append(".jpg"); |
| | | NumberData data = NumberData(); |
| | | data.data = cv::imread(path.c_str(), cv::IMREAD_GRAYSCALE); |
| | |
| | | //将时间样本载入内存中 |
| | | for (int i = 0;i < 60;i++) { |
| | | std::string sdir = "C:\\Users\\Administrator\\Desktop\\ocr\\time\\"; |
| | | if (_access(sdir.c_str(), 0)) { |
| | | sdir = "sample\\time\\"; |
| | | } |
| | | std::string path = sdir; |
| | | std::string num; |
| | | if (i < 10) { |
| | |
| | | #include "ImgDivider.h" |
| | | #include "Win32Util.h" |
| | | |
| | | bool isMainScreen(string str) { |
| | | bool isL2Screen(string str) { |
| | | if (str.find("同花顺(") != string::npos) { |
| | | cout << str << endl; |
| | | if (str.find("副屏") == string::npos) { |
| | | if (str.find("热门股") != string::npos || str.find("我的板块") != string::npos) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | bool isMainScreen(string str) { |
| | | if (str.find("同花顺(") != string::npos) { |
| | | cout << str << endl; |
| | | if (str.find("副屏") == string::npos) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | |
| | | |
| | | |
| | | //获取副屏1 |
| | | HWND getSecondWindow() { |
| | | HWND THSActionUtil::getSecondWindow() { |
| | | list<HWND> wlist = Win32Util::searchWindow("同花顺("); |
| | | list<HWND>::iterator ele; |
| | | for (ele = wlist.begin();ele != wlist.end();ele++) { |
| | |
| | | return 0; |
| | | } |
| | | |
| | | HWND THSActionUtil::getL2Win() { |
| | | HWND THSActionUtil::getMainWin() { |
| | | list<HWND> wlist = Win32Util::searchWindow("同花顺("); |
| | | list<HWND>::iterator ele; |
| | | for (ele = wlist.begin();ele != wlist.end();ele++) { |
| | |
| | | |
| | | |
| | | if (isMainScreen(str)) { |
| | | return hwnd; |
| | | } |
| | | |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | HWND THSActionUtil::getL2Win() { |
| | | list<HWND> wlist = Win32Util::searchWindow("同花顺("); |
| | | list<HWND>::iterator ele; |
| | | for (ele = wlist.begin();ele != wlist.end();ele++) { |
| | | HWND hwnd = *ele; |
| | | string str = Win32Util::getWindowName(hwnd); |
| | | |
| | | |
| | | if (isL2Screen(str)) { |
| | | return hwnd; |
| | | } |
| | | |
| | |
| | | fp2 = true; |
| | | } |
| | | |
| | | if (isMainScreen(str)) { |
| | | if (isL2Screen(str)) { |
| | | zp = true; |
| | | } |
| | | |
| | |
| | | break; |
| | | } |
| | | |
| | | if (isMainScreen(str)) { |
| | | if (isL2Screen(str)) { |
| | | cout << hwnd << endl; |
| | | //获取尺寸 |
| | | RECT rc; |
| | |
| | | Win32Util::click(x + 10, y + 21 * 7 + 5, 500); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | void THSActionUtil::openThirdScreen() { |
| | | |
| | | list<HWND> wlist = Win32Util::searchWindow("同花顺("); |
| | | |
| | | bool open = false; |
| | | HWND mainPage = 0; |
| | | |
| | | list<HWND>::iterator ele; |
| | | for (ele = wlist.begin();ele != wlist.end();ele++) { |
| | | HWND hwnd = *ele; |
| | | string str = Win32Util::getWindowName(hwnd); |
| | | if (isThirdScreen(str)) |
| | | { |
| | | cout << str << endl; |
| | | SetForegroundWindow(hwnd); |
| | | SetFocus(hwnd); |
| | | open = true; |
| | | break; |
| | | } |
| | | |
| | | if (isL2Screen(str)) { |
| | | cout << hwnd << endl; |
| | | //获取尺寸 |
| | | RECT rc; |
| | | GetWindowRect(hwnd, &rc); |
| | | if (rc.right - rc.left > 200 && rc.bottom - rc.top > 200) { |
| | | mainPage = hwnd; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (!open) { |
| | | if (mainPage <= 0) { |
| | | throw string("未找到首页"); |
| | | } |
| | | |
| | | Win32Util::focus(mainPage); |
| | | //查找主窗口的工具栏 |
| | | HWND tool = FindWindowExA(mainPage, NULL, "AfxControlBar100s", NULL); |
| | | |
| | | //获取第一个子窗口 |
| | | tool = FindWindowExA(tool, NULL, NULL, NULL); |
| | | cout << "操作栏:" << tool << endl; |
| | | //打开副屏,多窗按钮ID为:0x00007AF9 |
| | | HWND btn = GetDlgItem(tool, 0x00007AF9); |
| | | RECT rc; |
| | | GetWindowRect(btn, &rc); |
| | | //获取需要点击的位置 |
| | | int x = rc.left + (rc.right - rc.left) / 3; |
| | | int y = rc.top + (rc.bottom - rc.top) / 3; |
| | | //点击多窗 |
| | | Win32Util::click(x, y); |
| | | Sleep(50); |
| | | //点击副屏2 |
| | | Win32Util::click(x + 10, y + 21 * 8 + 5, 500); |
| | | } |
| | | } |
| | | |
| | | |
| | | //添加股票 |
| | | bool THSActionUtil::setGP(std::string quickCode, list<std::string> codeList, RecognitionManager* recognitionManager) { |
| | | |
| | |
| | | for (ele = wlist.begin();ele != wlist.end();ele++) { |
| | | HWND hwnd = *ele; |
| | | string str = Win32Util::getWindowName(hwnd); |
| | | if (isMainScreen(str)) { |
| | | if (isL2Screen(str)) { |
| | | cout << hwnd << endl; |
| | | //获取尺寸 |
| | | RECT rc; |
| | |
| | | int x = rc.left + result.startx + 5; |
| | | int y = rc.top + result.starty + 5; |
| | | Win32Util::focus(content); |
| | | Win32Util::click(x, y, 50); |
| | | //间隔1200ms再点击 |
| | | Win32Util::click(x, y, 1200); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | static std::list<GPCodeArea> getListenL2GPAreaAndCode(RecognitionManager* recognitionManager); |
| | | |
| | | public: |
| | | static HWND getMainWin(); |
| | | |
| | | static HWND getL2Win(); |
| | | |
| | | static HWND getThirdWindow(); |
| | | |
| | | static HWND getSecondWindow(); |
| | | //行业 |
| | | static HWND getIndustryWindow(); |
| | | |
| | |
| | | |
| | | //打开同花顺的副屏幕 |
| | | static void openSecondScreen(); |
| | | static void openThirdScreen(); |
| | | |
| | | //设置股票 |
| | | static bool setGP(std::string quickCode, list<std::string> codeList,RecognitionManager* recognitionManager); |
| | | //识别股票代码 |
| | |
| | | |
| | | |
| | | |
| | | list<list<GPDataStruct>> THSGPDataCapture::captureGPData(cv::Mat grayImg, SplitType types[], int length_per_num) { |
| | | list<list<GPDataStruct>> THSGPDataCapture::captureGPData(cv::Mat grayImg, SplitType types[], int length_per_num, int startColumn, int endColumn) { |
| | | |
| | | |
| | | list<int*> rowData = THSActionUtil::splitPlateRowArea(grayImg); |
| | | //每行的元素个数 |
| | | int ele_count_per_line = sizeof(types) / sizeof(types[0]); |
| | | int* splitResult = (int*)malloc(sizeof(int) * 4 * ele_count_per_line * rowData.size()); |
| | | int* rowIndex = (int*)malloc(sizeof(int) * 4 * rowData.size()); |
| | | int count = 0; |
| | | int* rowIndex = (int*)malloc(sizeof(int) * 4 * rowData.size()); |
| | | for (std::list<int*>::iterator ele = rowData.begin();ele != rowData.end();ele++) { |
| | | |
| | | string path = "C:\\Users\\Administrator\\Desktop\\ocr\\limit_up\\"; |
| | |
| | | free(*ele); |
| | | count++; |
| | | } |
| | | |
| | | |
| | | //每行的元素个数 |
| | | int ele_count_per_line = sizeof(types) / sizeof(types[0]); |
| | | int* splitResult = (int*)malloc(sizeof(int) * 4 * ele_count_per_line * rowData.size()); |
| | | int line_number_count = ele_count_per_line * length_per_num; |
| | | |
| | | openCLExcuter->splitPlateContentRowData(grayImg.data, grayImg.cols, grayImg.rows, rowIndex, rowData.size(), ele_count_per_line, 1, 2, splitResult); |
| | | openCLExcuter->splitPlateContentRowData(grayImg.data, grayImg.cols, grayImg.rows, rowIndex, rowData.size(), ele_count_per_line, startColumn, endColumn, splitResult); |
| | | |
| | | //分割数字 |
| | | unsigned char* zeroData = (unsigned char*)malloc(sizeof(unsigned char) * _NUMBER_GP_CODE_WIDTH * _NUMBER_GP_CODE_HEIGHT); |
| | |
| | | } |
| | | |
| | | char* priceCode; |
| | | priceCode = new char[20]; |
| | | sprintf_s(priceCode, money.length(), "%.2lf", stod(money)); |
| | | priceCode = new char[100]; |
| | | sprintf_s(priceCode, 100, "%.2lf", stod(money)); |
| | | std::string _str(priceCode); |
| | | delete[] priceCode; |
| | | money = _str; |
| | | |
| | | industryData.type = NUM_TYPE_MONEY; |
| | |
| | | } |
| | | |
| | | char* priceCode; |
| | | priceCode = new char[20]; |
| | | sprintf_s(priceCode, price.length(), "%.2lf", stod(price)); |
| | | priceCode = new char[100]; |
| | | sprintf_s(priceCode, 100, "%.2lf", stod(price)); |
| | | std::string _str(priceCode); |
| | | delete[] priceCode; |
| | | price = _str; |
| | | |
| | | industryData.type = NUM_TYPE_PRICE; |
| | |
| | | public: |
| | | void init(); |
| | | |
| | | static list<list<GPDataStruct>> captureGPData(cv::Mat grayImg, SplitType types[], int length_per_num); |
| | | static list<list<GPDataStruct>> captureGPData(cv::Mat grayImg, SplitType types[], int length_per_num,int startColumn,int endColumn); |
| | | |
| | | static cv::Mat grayImgs(cv::Mat img); |
| | | |
| | |
| | | //1s一次 |
| | | if (running_s && inited) { |
| | | clock_t start = clock(); |
| | | list<TradeSuccessData> datas = captureTradeSuccessInfo(); |
| | | cout << "耗时:" << clock() - start << " 数量:" << datas.size() << endl; |
| | | data_callback_success(datas, context); |
| | | datas.clear(); |
| | | Sleep(500); |
| | | try { |
| | | list<TradeSuccessData> datas = captureTradeSuccessInfo(); |
| | | cout << "耗时:" << clock() - start << " 数量:" << datas.size() << endl; |
| | | data_callback_success(datas, context); |
| | | datas.clear(); |
| | | } |
| | | catch (...) { |
| | | |
| | | } |
| | | Sleep(10); |
| | | } |
| | | else { |
| | | Sleep(2000); |
| | |
| | | //1s一次 |
| | | if (running_d && inited) { |
| | | clock_t start = clock(); |
| | | list<TradeDelegateData> datas = captureTradeDelegateInfo(); |
| | | string money = getAvaiableMoney(); |
| | | cout << "耗时:" << clock() - start << " 数量:" << datas.size() << endl; |
| | | data_callback_delegate(datas, money, context); |
| | | datas.clear(); |
| | | Sleep(100); |
| | | try { |
| | | list<TradeDelegateData> datas = captureTradeDelegateInfo(); |
| | | string money = getAvaiableMoney(); |
| | | cout << "耗时:" << clock() - start << " 数量:" << datas.size() << endl; |
| | | data_callback_delegate(datas, money, context); |
| | | datas.clear(); |
| | | } |
| | | catch (...) { |
| | | |
| | | } |
| | | Sleep(5); |
| | | } |
| | | else { |
| | | Sleep(2000); |
| | |
| | | } |
| | | if (rowData.size() < 2) |
| | | { |
| | | free(grayImg.data); |
| | | grayImg.release(); |
| | | for (list<int*>::iterator ele = rowData.begin();ele != rowData.end();ele++) { |
| | | free(*ele); |
| | | } |
| | | return dataList; |
| | | } |
| | | //ȥͷȥβ |
| | |
| | | priceCode = new char[20]; |
| | | sprintf_s(priceCode, price.length(), "%.2lf", stod(price)); |
| | | std::string _str(priceCode); |
| | | delete[] priceCode; |
| | | |
| | | price = _str; |
| | | |
| | | //金额 |
| | |
| | | chCode = new char[20]; |
| | | sprintf_s(chCode, money.length(), "%.2lf", stod(money)); |
| | | std::string str(chCode); |
| | | delete[] chCode; |
| | | money = str; |
| | | |
| | | //合同编号 |
| | |
| | | free(numberResult[i]); |
| | | } |
| | | |
| | | |
| | | free(totalNumberData); |
| | | free(numberResult); |
| | | free(rowIndex); |
| | | free(splitResult); |
| | |
| | | list<TradeDelegateData> TradeListCapture::captureTradeDelegateInfo(cv::Mat oimg) { |
| | | |
| | | cv::Mat grayImg = grayImgs(oimg); |
| | | list<TradeDelegateData> dataList; |
| | | //分隔元素 |
| | | int empty_start = -1; |
| | | int empty_end = -1; |
| | | int data_start = -1; |
| | | int data_end = -1; |
| | | list<int*> rowData; |
| | | for (int r = 0;r < grayImg.rows;r++) { |
| | | if (ImgDivider::isRowEmpty(grayImg, r, 0, 50)) { |
| | | |
| | | if (empty_start < 0) { |
| | | empty_start = r; |
| | | empty_end = r; |
| | | list<TradeDelegateData> dataList; |
| | | //分隔元素 |
| | | int empty_start = -1; |
| | | int empty_end = -1; |
| | | int data_start = -1; |
| | | int data_end = -1; |
| | | list<int*> rowData; |
| | | for (int r = 0;r < grayImg.rows;r++) { |
| | | if (ImgDivider::isRowEmpty(grayImg, r, 0, 50)) { |
| | | |
| | | if (empty_start < 0) { |
| | | empty_start = r; |
| | | empty_end = r; |
| | | } |
| | | else { |
| | | empty_end = r; |
| | | } |
| | | if (data_start > -1 && data_end > -1 && data_end - data_start > 5) { |
| | | printf("%d-%d\n", data_start, data_end); |
| | | int* d = (int*)malloc(sizeof(int) * 2); |
| | | d[0] = data_start; |
| | | d[1] = data_end; |
| | | rowData.push_back(d); |
| | | data_start = -1; |
| | | data_end = -1; |
| | | } |
| | | } |
| | | else { |
| | | empty_end = r; |
| | | } |
| | | if (data_start > -1 && data_end > -1 && data_end - data_start > 5) { |
| | | printf("%d-%d\n", data_start, data_end); |
| | | int* d = (int*)malloc(sizeof(int) * 2); |
| | | d[0] = data_start; |
| | | d[1] = data_end; |
| | | rowData.push_back(d); |
| | | data_start = -1; |
| | | data_end = -1; |
| | | } |
| | | } |
| | | else { |
| | | empty_start = -1; |
| | | empty_end = -1; |
| | | empty_start = -1; |
| | | empty_end = -1; |
| | | |
| | | if (data_start < 0) { |
| | | data_start = r; |
| | | data_end = r; |
| | | } |
| | | else { |
| | | data_end = r; |
| | | } |
| | | } |
| | | } |
| | | if (rowData.size() < 2) |
| | | { |
| | | return dataList; |
| | | } |
| | | |
| | | //ȥͷȥβ |
| | | list<int*>::iterator start = rowData.begin(); |
| | | list<int*>::iterator end = rowData.end(); |
| | | free(*start); |
| | | rowData.erase(start); |
| | | std::advance(end, -1); |
| | | free(*end); |
| | | rowData.erase(end); |
| | | |
| | | int* rowIndex = (int*)malloc(sizeof(int) * rowData.size() * 4); |
| | | |
| | | int index = 0; |
| | | for (list<int*>::iterator ele = rowData.begin();ele != rowData.end();ele++) { |
| | | rowIndex[index * 4 + 0] = 0; |
| | | rowIndex[index * 4 + 1] = (*ele)[0]; |
| | | rowIndex[index * 4 + 2] = grayImg.cols - 1; |
| | | rowIndex[index * 4 + 3] = (*ele)[1]; |
| | | free(*ele); |
| | | index++; |
| | | } |
| | | |
| | | |
| | | int ele_count_per_line = 7; |
| | | int length_per_num = 8; |
| | | |
| | | |
| | | int* splitResult = (int*)malloc(sizeof(int) * 4 * ele_count_per_line * rowData.size()); |
| | | |
| | | openCLExcuter->splitPlateContentRowData(grayImg.data, grayImg.cols, grayImg.rows, rowIndex, rowData.size(), ele_count_per_line, 0, 6, splitResult); |
| | | |
| | | if (false) { |
| | | //保存分隔结果 |
| | | for (int i = 0;i < rowData.size();i++) { |
| | | int start = i * ele_count_per_line * 4; |
| | | for (int j = 0;j < ele_count_per_line;j++) |
| | | { |
| | | |
| | | int startx = splitResult[start]; |
| | | int starty = splitResult[start + 1]; |
| | | int endx = splitResult[start + 2]; |
| | | int endy = splitResult[start + 3]; |
| | | start += 4; |
| | | string path = "C:\\Users\\Administrator\\Desktop\\ocr\\trade\\"; |
| | | path.append(to_string(i)).append("_").append(to_string(j)).append(".jpg"); |
| | | cv::imwrite(path, cv::Mat(grayImg, cv::Rect(startx, starty, endx - startx + 1, endy - starty + 1))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //分割数字 |
| | | unsigned char* zeroData = (unsigned char*)malloc(sizeof(unsigned char) * _NUMBER_L2_WIDTH * _NUMBER_L2_HEIGHT); |
| | | for (int r = 0;r < _NUMBER_L2_HEIGHT;r++) { |
| | | for (int c = 0;c < _NUMBER_L2_WIDTH;c++) |
| | | { |
| | | zeroData[r * _NUMBER_L2_WIDTH + c] = ImgUtil::NUMS_LEVEL2[0].data.ptr<uchar>(r)[c]; |
| | | } |
| | | } |
| | | |
| | | int line_number_count = ele_count_per_line * length_per_num; |
| | | |
| | | unsigned char* totalNumberData = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * rowData.size()) * _NUMBER_L2_WIDTH * 10 * line_number_count); |
| | | |
| | | UcharDataInfo typesData = UcharDataInfo(); |
| | | unsigned char types[] = { NUM_TYPE_TIME,NUM_TYPE_CODE,NUM_TYPE_CODE,NUM_TYPE_PRICE,NUM_TYPE_PRICE,NUM_TYPE_CODE, NUM_TYPE_CODE }; |
| | | typesData.length = ele_count_per_line; |
| | | typesData.data = types; |
| | | |
| | | openCLExcuter->splitL2NumNew(grayImg, IntDataInfo({ splitResult,(int)(ele_count_per_line * rowData.size()) }), UcharDataInfo({ totalNumberData, -1 }), typesData, zeroData, _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, ele_count_per_line, length_per_num); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //识别数字 |
| | | uchar* templateNums = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * rowData.size()) * _NUMBER_L2_WIDTH * 10 * line_number_count); |
| | | openCLExcuter->createNumberTemplates(rowData.size(), _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, line_number_count, ImgUtil::numsOneLevel_level2, templateNums); |
| | | uchar** numberResult = openCLExcuter->recognition_numbers(totalNumberData, templateNums, rowData.size() * _NUMBER_L2_HEIGHT, _NUMBER_L2_WIDTH * 10 * line_number_count, _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, line_number_count); |
| | | |
| | | for (int i = 0;i < rowData.size();i++) { |
| | | TradeDelegateData delegateData = TradeDelegateData(); |
| | | //时间 |
| | | string time = ""; |
| | | for (int j = length_per_num - 6;j < length_per_num;j++) |
| | | { |
| | | if (j - (length_per_num - 6) == 2 || j - (length_per_num - 6) == 4) |
| | | time.append(":"); |
| | | time.append(to_string(numberResult[i][length_per_num * 0 + j])); |
| | | } |
| | | |
| | | //代码 |
| | | string code = ""; |
| | | for (int j = length_per_num - 6;j < length_per_num;j++) |
| | | { |
| | | code.append(to_string(numberResult[i][length_per_num * 1 + j])); |
| | | } |
| | | |
| | | |
| | | //委托数量 |
| | | string num = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | num.append(to_string(numberResult[i][length_per_num * 2 + j])); |
| | | } |
| | | num = to_string(stoi(num)); |
| | | |
| | | |
| | | //委托价格 |
| | | string delegate_price = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | if(length_per_num-j==3) |
| | | delegate_price.append("."); |
| | | delegate_price.append(to_string(numberResult[i][length_per_num * 3 + j])); |
| | | } |
| | | delegate_price = to_string(stod(delegate_price)); |
| | | char* chCode; |
| | | chCode = new char[20]; |
| | | sprintf_s(chCode, delegate_price.length(), "%.3lf", stod(delegate_price)); |
| | | std::string delegate_price_str(chCode); |
| | | |
| | | delegate_price = delegate_price_str; |
| | | |
| | | |
| | | //成交均价 |
| | | string percent_price = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | if (length_per_num - j == 3) |
| | | percent_price.append("."); |
| | | percent_price.append(to_string(numberResult[i][length_per_num * 4 + j])); |
| | | } |
| | | |
| | | chCode = new char[20]; |
| | | sprintf_s(chCode, percent_price.length(), "%.3lf", stod(percent_price)); |
| | | std::string percent_price_str(chCode); |
| | | |
| | | percent_price = percent_price_str; |
| | | |
| | | |
| | | //成交数量 |
| | | string success_num = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | success_num.append(to_string(numberResult[i][length_per_num * 5 + j])); |
| | | } |
| | | success_num = to_string(stoi(success_num)); |
| | | |
| | | |
| | | //买入卖出 |
| | | int start = i * 4 * ele_count_per_line + 6 * 4; |
| | | int startx = splitResult[start]; |
| | | int starty = splitResult[start + 1]; |
| | | int endx = splitResult[start + 2]; |
| | | int endy = splitResult[start + 3]; |
| | | |
| | | int count = 0; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = startx;c <= endx;c++) { |
| | | uchar v = grayImg.ptr<uchar>(r)[c]; |
| | | if (v >= _IMG_BINARY_THRESHOLD) { |
| | | count++; |
| | | if (data_start < 0) { |
| | | data_start = r; |
| | | data_end = r; |
| | | } |
| | | else { |
| | | data_end = r; |
| | | } |
| | | } |
| | | } |
| | | if (count > 50) { |
| | | //卖出 |
| | | delegateData.type = TRADE_TYPE_SELL; |
| | | if (rowData.size() < 2) |
| | | { |
| | | free(grayImg.data); |
| | | grayImg.release(); |
| | | for (list<int*>::iterator ele = rowData.begin();ele != rowData.end();ele++) { |
| | | free(*ele); |
| | | } |
| | | return dataList; |
| | | } |
| | | else { |
| | | //买入 |
| | | delegateData.type = TRADE_TYPE_BUY; |
| | | |
| | | //ȥͷȥβ |
| | | list<int*>::iterator start = rowData.begin(); |
| | | list<int*>::iterator end = rowData.end(); |
| | | free(*start); |
| | | rowData.erase(start); |
| | | std::advance(end, -1); |
| | | free(*end); |
| | | rowData.erase(end); |
| | | |
| | | int* rowIndex = (int*)malloc(sizeof(int) * rowData.size() * 4); |
| | | |
| | | int index = 0; |
| | | for (list<int*>::iterator ele = rowData.begin();ele != rowData.end();ele++) { |
| | | rowIndex[index * 4 + 0] = 0; |
| | | rowIndex[index * 4 + 1] = (*ele)[0]; |
| | | rowIndex[index * 4 + 2] = grayImg.cols - 1; |
| | | rowIndex[index * 4 + 3] = (*ele)[1]; |
| | | free(*ele); |
| | | index++; |
| | | } |
| | | |
| | | |
| | | delegateData.index = i; |
| | | delegateData.code = code; |
| | | delegateData.time = time; |
| | | delegateData.num = num; |
| | | delegateData.price = delegate_price; |
| | | delegateData.trade_price = percent_price; |
| | | delegateData.trade_num = success_num; |
| | | int ele_count_per_line = 7; |
| | | int length_per_num = 8; |
| | | |
| | | |
| | | dataList.push_back(delegateData); |
| | | free(numberResult[i]); |
| | | } |
| | | int* splitResult = (int*)malloc(sizeof(int) * 4 * ele_count_per_line * rowData.size()); |
| | | |
| | | openCLExcuter->splitPlateContentRowData(grayImg.data, grayImg.cols, grayImg.rows, rowIndex, rowData.size(), ele_count_per_line, 0, 6, splitResult); |
| | | |
| | | if (false) { |
| | | //保存分隔结果 |
| | | for (int i = 0;i < rowData.size();i++) { |
| | | int start = i * ele_count_per_line * 4; |
| | | for (int j = 0;j < ele_count_per_line;j++) |
| | | { |
| | | |
| | | int startx = splitResult[start]; |
| | | int starty = splitResult[start + 1]; |
| | | int endx = splitResult[start + 2]; |
| | | int endy = splitResult[start + 3]; |
| | | start += 4; |
| | | string path = "C:\\Users\\Administrator\\Desktop\\ocr\\trade\\"; |
| | | path.append(to_string(i)).append("_").append(to_string(j)).append(".jpg"); |
| | | cv::imwrite(path, cv::Mat(grayImg, cv::Rect(startx, starty, endx - startx + 1, endy - starty + 1))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | free(numberResult); |
| | | free(rowIndex); |
| | | free(splitResult); |
| | | free(zeroData); |
| | | free(templateNums); |
| | | free(grayImg.data); |
| | | grayImg.release(); |
| | | return dataList; |
| | | //分割数字 |
| | | unsigned char* zeroData = (unsigned char*)malloc(sizeof(unsigned char) * _NUMBER_L2_WIDTH * _NUMBER_L2_HEIGHT); |
| | | for (int r = 0;r < _NUMBER_L2_HEIGHT;r++) { |
| | | for (int c = 0;c < _NUMBER_L2_WIDTH;c++) |
| | | { |
| | | zeroData[r * _NUMBER_L2_WIDTH + c] = ImgUtil::NUMS_LEVEL2[0].data.ptr<uchar>(r)[c]; |
| | | } |
| | | } |
| | | |
| | | int line_number_count = ele_count_per_line * length_per_num; |
| | | |
| | | unsigned char* totalNumberData = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * rowData.size()) * _NUMBER_L2_WIDTH * 10 * line_number_count); |
| | | |
| | | UcharDataInfo typesData = UcharDataInfo(); |
| | | unsigned char types[] = { NUM_TYPE_TIME,NUM_TYPE_CODE,NUM_TYPE_CODE,NUM_TYPE_PRICE,NUM_TYPE_PRICE,NUM_TYPE_CODE, NUM_TYPE_CODE }; |
| | | typesData.length = ele_count_per_line; |
| | | typesData.data = types; |
| | | |
| | | openCLExcuter->splitL2NumNew(grayImg, IntDataInfo({ splitResult,(int)(ele_count_per_line * rowData.size()) }), UcharDataInfo({ totalNumberData, -1 }), typesData, zeroData, _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, ele_count_per_line, length_per_num); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //识别数字 |
| | | uchar* templateNums = (unsigned char*)malloc(sizeof(unsigned char) * (_NUMBER_L2_HEIGHT * rowData.size()) * _NUMBER_L2_WIDTH * 10 * line_number_count); |
| | | openCLExcuter->createNumberTemplates(rowData.size(), _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, line_number_count, ImgUtil::numsOneLevel_level2, templateNums); |
| | | uchar** numberResult = openCLExcuter->recognition_numbers(totalNumberData, templateNums, rowData.size() * _NUMBER_L2_HEIGHT, _NUMBER_L2_WIDTH * 10 * line_number_count, _NUMBER_L2_WIDTH, _NUMBER_L2_HEIGHT, line_number_count); |
| | | |
| | | for (int i = 0;i < rowData.size();i++) { |
| | | TradeDelegateData delegateData = TradeDelegateData(); |
| | | //时间 |
| | | string time = ""; |
| | | for (int j = length_per_num - 6;j < length_per_num;j++) |
| | | { |
| | | if (j - (length_per_num - 6) == 2 || j - (length_per_num - 6) == 4) |
| | | time.append(":"); |
| | | time.append(to_string(numberResult[i][length_per_num * 0 + j])); |
| | | } |
| | | |
| | | //代码 |
| | | string code = ""; |
| | | for (int j = length_per_num - 6;j < length_per_num;j++) |
| | | { |
| | | code.append(to_string(numberResult[i][length_per_num * 1 + j])); |
| | | } |
| | | |
| | | |
| | | //委托数量 |
| | | string num = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | num.append(to_string(numberResult[i][length_per_num * 2 + j])); |
| | | } |
| | | num = to_string(stoi(num)); |
| | | |
| | | |
| | | //委托价格 |
| | | string delegate_price = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | if (length_per_num - j == 3) |
| | | delegate_price.append("."); |
| | | delegate_price.append(to_string(numberResult[i][length_per_num * 3 + j])); |
| | | } |
| | | delegate_price = to_string(stod(delegate_price)); |
| | | char* chCode; |
| | | chCode = new char[20]; |
| | | sprintf_s(chCode, delegate_price.length(), "%.3lf", stod(delegate_price)); |
| | | std::string delegate_price_str(chCode); |
| | | |
| | | delegate_price = delegate_price_str; |
| | | |
| | | |
| | | //成交均价 |
| | | string percent_price = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | if (length_per_num - j == 3) |
| | | percent_price.append("."); |
| | | percent_price.append(to_string(numberResult[i][length_per_num * 4 + j])); |
| | | } |
| | | |
| | | chCode = new char[20]; |
| | | sprintf_s(chCode, percent_price.length(), "%.3lf", stod(percent_price)); |
| | | std::string percent_price_str(chCode); |
| | | |
| | | percent_price = percent_price_str; |
| | | |
| | | |
| | | //成交数量 |
| | | string success_num = ""; |
| | | for (int j = 0;j < length_per_num;j++) |
| | | { |
| | | success_num.append(to_string(numberResult[i][length_per_num * 5 + j])); |
| | | } |
| | | success_num = to_string(stoi(success_num)); |
| | | |
| | | |
| | | //买入卖出 |
| | | int start = i * 4 * ele_count_per_line + 6 * 4; |
| | | int startx = splitResult[start]; |
| | | int starty = splitResult[start + 1]; |
| | | int endx = splitResult[start + 2]; |
| | | int endy = splitResult[start + 3]; |
| | | |
| | | int count = 0; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = startx;c <= endx;c++) { |
| | | uchar v = grayImg.ptr<uchar>(r)[c]; |
| | | if (v >= _IMG_BINARY_THRESHOLD) { |
| | | count++; |
| | | } |
| | | } |
| | | } |
| | | if (count > 50) { |
| | | //卖出 |
| | | delegateData.type = TRADE_TYPE_SELL; |
| | | } |
| | | else { |
| | | //买入 |
| | | delegateData.type = TRADE_TYPE_BUY; |
| | | } |
| | | |
| | | |
| | | delegateData.index = i; |
| | | delegateData.code = code; |
| | | delegateData.time = time; |
| | | delegateData.num = num; |
| | | delegateData.price = delegate_price; |
| | | delegateData.trade_price = percent_price; |
| | | delegateData.trade_num = success_num; |
| | | |
| | | |
| | | dataList.push_back(delegateData); |
| | | free(numberResult[i]); |
| | | } |
| | | |
| | | free(totalNumberData); |
| | | free(numberResult); |
| | | free(rowIndex); |
| | | free(splitResult); |
| | | free(zeroData); |
| | | free(templateNums); |
| | | free(grayImg.data); |
| | | grayImg.release(); |
| | | |
| | | return dataList; |
| | | } |
| | | |
| | | |
| | |
| | | #include "Win32Util.h" |
| | | |
| | | #include <thread> |
| | | #include <vector> |
| | | |
| | | |
| | | void clickRunner(int delay) // 函数名字可随意 |
| | |
| | | Sleep(delay); |
| | | for (int i = 0;i < nums.length();i++) |
| | | { |
| | | keybd_event(nums.c_str()[i], 0, 0, 0); |
| | | int code = int(nums.c_str()[i]); |
| | | if (code == '.') |
| | | { |
| | | code = 110; |
| | | } |
| | | keybd_event(code, 0, 0, 0); |
| | | Sleep(5); |
| | | keybd_event(nums.c_str()[i], 0, KEYEVENTF_KEYUP, 0); |
| | | keybd_event(code, 0, KEYEVENTF_KEYUP, 0); |
| | | Sleep(20); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | void Win32Util::keyboard(int code, int delay) { |
| | | thread runner(kbKeyRunner, code, delay); |
| | | runner.join(); |
| | | } |
| | | } |
| | | |
| | | DEVMODE Win32Util::getL2ScreenInfo() |
| | | { |
| | | //获取屏幕数量 |
| | | DEVMODE dm; |
| | | int screenNUm = GetSystemMetrics(SM_CMONITORS); |
| | | for (int i = 0;i < screenNUm;i++) { |
| | | DISPLAY_DEVICE device; |
| | | ZeroMemory(&device, sizeof(DISPLAY_DEVICE)); |
| | | device.cb = sizeof(DISPLAY_DEVICE); |
| | | EnumDisplayDevices(NULL, i, &device, NULL); |
| | | |
| | | |
| | | ZeroMemory(&dm, sizeof(dm)); |
| | | dm.dmSize = sizeof(dm); |
| | | EnumDisplaySettings(device.DeviceName, ENUM_CURRENT_SETTINGS, &dm); |
| | | |
| | | if (dm.dmPelsWidth > 3000) { |
| | | return dm; |
| | | } |
| | | } |
| | | throw string("尚未找到适合L2的显示设备"); |
| | | return DEVMODE(); |
| | | } |
| | | |
| | | void Win32Util::moveWin(HWND win, int x, int y, int width, int height) { |
| | | MoveWindow(win,x,y,width,height,TRUE); |
| | | } |
| | | |
| | | bool Win32Util::isWindowShow(HWND win) { |
| | | return IsWindowVisible(win); |
| | | } |
| | | |
| | | void Win32Util::showWindow(HWND hwnd) { |
| | | ShowWindow(hwnd, SW_SHOWNORMAL); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | //键盘输入其他键 |
| | | static void keyboard(int code, int delay=0); |
| | | |
| | | //获取L2屏幕数据 |
| | | static DEVMODE getL2ScreenInfo(); |
| | | |
| | | //移动窗口 |
| | | static void moveWin(HWND win, int x,int y,int width,int height); |
| | | |
| | | //窗体是否显示 |
| | | static bool isWindowShow(HWND hwnd); |
| | | //显示窗口 |
| | | static void showWindow(HWND hwnd); |
| | | }; |
| | | |
| | |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | //printf("没找到小数点:%d", index); |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | |
| | | } |
| | | else { |
| | | //printf("找到了小数点:%d", index); |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | |
| | | nps[5] = starty; |
| | | nps[6] = num_end; |
| | | nps[7] = endy; |
| | | |
| | | } |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | |
| | | |
| | |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | |
| | | nps[5] = starty; |
| | | nps[6] = endx; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | } |
| | | //代码与数字 |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | printf("未查找到冒号:m1_s:%d m1_end:%d m2_s:%d m2_e:%d\n", m1_s, m1_e, m2_s, m2_e); |
| | | //printf("未查找到冒号:m1_s:%d m1_end:%d m2_s:%d m2_e:%d\n", m1_s, m1_e, m2_s, m2_e); |
| | | return; |
| | | } |
| | | |
New file |
| | |
| | | |
| | | __kernel void recognition_numbers_1(__global const unsigned char* a_in, |
| | | __global const unsigned char* b_in, int width, int num_width, int num_height, int num_count, |
| | | __global unsigned char* result) { |
| | | |
| | | int p = get_global_id(0); |
| | | int startIndex = p / width * width * num_width * num_height + p % (num_count * 10) * num_width; |
| | | unsigned char t = 0; |
| | | for (int r = 0;r < num_height;r++) |
| | | for (int c = 0;c < num_width;c++) { |
| | | int index = startIndex + num_width * width * r + c; |
| | | t += abs(a_in[index] - b_in[index]); |
| | | if (p == 0) { |
| | | //printf("ֵ:%d-%d \n", a_in[index], b_in[index]); |
| | | } |
| | | } |
| | | result[p] = t; |
| | | } |
| | | |
| | | |
| | | __kernel void recognition_numbers_2(__global const unsigned char* a_in, |
| | | __global unsigned char* result) { |
| | | |
| | | int index = get_global_id(0); |
| | | int startIndex = index * 10; |
| | | int endIndex = (index + 1) * 10; |
| | | |
| | | //获取最小值 |
| | | int min = 255; |
| | | int minIndex = 11; |
| | | |
| | | for (int i = startIndex;i < endIndex;i++) |
| | | { |
| | | if (a_in[i] < min) { |
| | | min = a_in[i]; |
| | | minIndex = i; |
| | | } |
| | | } |
| | | |
| | | //printf("最小值:%d - %d - %d \n", index, min, minIndex - startIndex); |
| | | |
| | | result[index] = minIndex - startIndex; |
| | | } |
| | | |
| | | int get_one_level_position(int width, int x, int y) { |
| | | return width * y + x; |
| | | } |
| | | |
| | | unsigned char get_binary_value(unsigned char v) { |
| | | return v >= 64 ? 1 : 0; |
| | | } |
| | | |
| | | //分隔板块数字 |
| | | __kernel void split_plate_num(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, __global const unsigned char* types, int width, int num_width, int num_height, int ele_count_per_line, int length_per_num, |
| | | __global unsigned char* result) { |
| | | |
| | | int index = get_global_id(0); |
| | | //区域坐标 |
| | | int startP = index * 4; |
| | | int startx = pos_in[startP]; |
| | | int starty = pos_in[startP + 1]; |
| | | int endx = pos_in[startP + 2]; |
| | | int endy = pos_in[startP + 3]; |
| | | |
| | | if (startx > 0) |
| | | { |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | } |
| | | int cols = endx - startx + 1; |
| | | int rows = endy - starty + 1; |
| | | |
| | | //每个元素占用6个数字的空间,不够的前面填充0 |
| | | int num_count = ele_count_per_line * length_per_num; |
| | | |
| | | int nps[12]; |
| | | //只能识别4种数字 |
| | | unsigned char type = types[index % ele_count_per_line]; |
| | | //printf("ele_count_line:%d\n", ele_count_line); |
| | | //时间 |
| | | if (type == 0) { |
| | | //时间 |
| | | int s = cols / 2; |
| | | int i; |
| | | //往前查找冒号 |
| | | int m1_s = -1, m1_e = -1, m2_s = -1, m2_e = -1; |
| | | uchar temp[10]; |
| | | for (i = s;i > -1;i--) { |
| | | if (i < 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i - 1, endy)]); |
| | | |
| | | |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i - 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i - 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 1)]); |
| | | temp[8] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy - 2)]); |
| | | temp[9] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 2)]); |
| | | if (temp[3] > 0 && temp[2] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | int t = temp[0] + temp[1] + temp[4] + temp[5] + temp[8] + temp[9]; |
| | | if (t == 0) { |
| | | m1_s = i - 5; |
| | | m1_e = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //往后查找冒号 |
| | | |
| | | for (i = s;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]); |
| | | temp[8] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 2)]); |
| | | temp[9] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 2)]); |
| | | if (temp[2] > 0 && temp[3] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | int t = temp[0] + temp[1] + temp[4] + temp[5] + temp[8] + temp[9]; |
| | | if (t == 0) { |
| | | m2_s = i; |
| | | m2_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | //没有分割成功的话填充0 |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | //3个时间的坐标 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m1_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m1_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = startx + m2_s - 1; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = startx + m2_e + 1; |
| | | nps[9] = starty; |
| | | nps[10] = endx; |
| | | nps[11] = endy; |
| | | } |
| | | |
| | | |
| | | } |
| | | //金额 |
| | | else if (type == 1) { |
| | | //查找单位前的空格 |
| | | int num_end = -1; |
| | | int i; |
| | | for (i = endx - 11;i >= startx;i--) { |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, i, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | num_end = i - 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (num_end >= 0) { |
| | | endx = num_end; |
| | | } |
| | | |
| | | //去除上下的空白 |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | |
| | | |
| | | |
| | | cols = endx - startx + 1; |
| | | |
| | | |
| | | |
| | | |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[8]; |
| | | |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]); |
| | | if (temp[2] > 0 && temp[3] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | |
| | | if (temp[0] + temp[1] + temp[4] + temp[5] == 0) |
| | | { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy - 1;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = num_end; |
| | | nps[7] = endy; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //价格 |
| | | else if (type == 2) { |
| | | //股价 |
| | | |
| | | //printf("startx:%d starty:%d endx:%d endy:%d\n",startx,starty,endx,endy); |
| | | |
| | | //往前查找小数点 |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[8]; |
| | | int i; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]); |
| | | if (temp[2] > 0 && temp[3] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | |
| | | if (temp[0] + temp[1] + temp[4] + temp[5] == 0) |
| | | { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy - 1;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = endx; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | |
| | | } |
| | | //代码与数字 |
| | | else if (type == 3 || type == 4) { |
| | | //手数 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = endx; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | //分隔数据 |
| | | |
| | | //最大分割20个数 |
| | | int numCount = 0; |
| | | //记录分割得到的数据 |
| | | int numberCols[20 * 2]; |
| | | |
| | | int i; |
| | | for (i = 0;i < 3;i++) { |
| | | if (nps[i * 4] == -1) { |
| | | break; |
| | | } |
| | | int _startx = nps[i * 4]; |
| | | int _starty = nps[i * 4 + 1]; |
| | | int _endx = nps[i * 4 + 2]; |
| | | int _endy = nps[i * 4 + 3]; |
| | | int _cols = _endx - _startx + 1; |
| | | |
| | | |
| | | |
| | | int c, startC = -1, endC = -1; |
| | | for (c = 0;c < _cols;c++) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = _starty;y <= _endy;y++) { |
| | | unsigned char value = get_binary_value(img_in[get_one_level_position(width, _startx + c, y)]); |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (empty) { |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | startC = -1; |
| | | endC = -1; |
| | | } |
| | | else { |
| | | if (startC == -1) { |
| | | startC = c; |
| | | endC = c; |
| | | } |
| | | else { |
| | | endC = c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | } |
| | | |
| | | int zeroCount = length_per_num - numCount; |
| | | //最大为20位数 |
| | | int fresult[20 * 2]; |
| | | for (i = 0;i < zeroCount;i++) { |
| | | fresult[i * 2] = -1; |
| | | fresult[i * 2 + 1] = -1; |
| | | } |
| | | |
| | | for (i = 0;i < numCount;i++) { |
| | | fresult[(i + zeroCount) * 2] = numberCols[i * 2]; |
| | | fresult[(i + zeroCount) * 2 + 1] = numberCols[i * 2 + 1]; |
| | | } |
| | | |
| | | //开始填充数据 |
| | | for (i = 0;i < length_per_num;i++) { |
| | | |
| | | unsigned char numData[100 * 100]; |
| | | |
| | | if (fresult[i * 2] == -1) { |
| | | //填充0 |
| | | for (int r = 0;r < num_height;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = get_binary_value(zero[r * num_width + c]); |
| | | //设置输出坐标的值 |
| | | numData[r * num_width + c] = value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else { |
| | | int _startx = fresult[i * 2]; |
| | | int _endx = fresult[i * 2 + 1]; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = 0; |
| | | if (_startx + c <= _endx) { |
| | | //填充空白0 |
| | | value = get_binary_value(img_in[get_one_level_position(width, _startx + c, r)]); |
| | | //设置输出坐标的值 |
| | | numData[(r - starty) * num_width + c] = value; |
| | | } |
| | | else { |
| | | numData[(r - starty) * num_width + c] = 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int rowDataCount = num_height * num_width * 10 * num_count; |
| | | int rowIndex = index / ele_count_per_line; |
| | | int index_0 = rowDataCount * rowIndex; |
| | | //行偏移量 |
| | | int index_2 = (num_width * 10) * (length_per_num * (index % ele_count_per_line) + i); |
| | | |
| | | for (int re = 0;re < 10;re++) { |
| | | int index_3 = re * num_width; |
| | | for (int r = 0;r < num_height;r++) { |
| | | int index_1 = r * (num_width * 10 * num_count); |
| | | for (int c = 0;c < num_width;c++) { |
| | | int findex = index_0 + index_1 + index_2 + index_3 + c; |
| | | //printf("index:%d-findex:%d value:%d \n", index, findex, numData[r * num_width + c]); |
| | | result[findex] = numData[r * num_width + c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //printf("\n"); |
| | | } |
| | | |
| | | |
| | | |
| | | __kernel void split_l2_num_new(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, __global const unsigned char* types, int width, int num_width, int num_height, int ele_count_per_line, int length_per_num, |
| | | __global unsigned char* result) { |
| | | |
| | | //printf("ele_count_per_line:%d length_per_num:%d\n", ele_count_per_line, length_per_num); |
| | | |
| | | int index = get_global_id(0); |
| | | //区域坐标 |
| | | int startP = index * 4; |
| | | int startx = pos_in[startP]; |
| | | int starty = pos_in[startP + 1]; |
| | | int endx = pos_in[startP + 2]; |
| | | int endy = pos_in[startP + 3]; |
| | | |
| | | if (startx > 0) |
| | | { |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | } |
| | | int cols = endx - startx + 1; |
| | | int rows = endy - starty + 1; |
| | | |
| | | //每个元素占用6个数字的空间,不够的前面填充0 |
| | | int num_count = ele_count_per_line * length_per_num; |
| | | |
| | | int nps[12]; |
| | | //只能识别4种数字 |
| | | unsigned char type = types[index % ele_count_per_line]; |
| | | //printf("ele_count_line:%d\n", ele_count_line); |
| | | //时间 |
| | | if (type == 0) { |
| | | //时间 |
| | | int s = cols / 2; |
| | | int i; |
| | | //往前查找冒号 |
| | | int m1_s = -1, m1_e = -1, m2_s = -1, m2_e = -1; |
| | | uchar temp[7]; |
| | | for (i = s;i > -1;i--) { |
| | | if (i < 6) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i - 1, endy)]); |
| | | |
| | | |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i - 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i - 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i - 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m1_s = i - 6; |
| | | m1_e = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //往后查找冒号 |
| | | |
| | | for (i = s;i < cols;i++) { |
| | | if (i > cols - 6) { |
| | | break; |
| | | } |
| | | |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m2_s = i; |
| | | m2_e = i + 6; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | //没有分割成功的话填充0 |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | //3个时间的坐标 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m1_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m1_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = startx + m2_s - 1; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = startx + m2_e + 1; |
| | | nps[9] = starty; |
| | | nps[10] = endx; |
| | | nps[11] = endy; |
| | | } |
| | | |
| | | |
| | | } |
| | | //金额 |
| | | else if (type == 1) { |
| | | //查找单位前的空格 |
| | | int num_end = -1; |
| | | int i; |
| | | for (i = endx - 9;i >= startx;i--) { |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, i, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | num_end = i - 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (num_end >= 0) { |
| | | endx = num_end; |
| | | } |
| | | |
| | | //去除上下的空白 |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | |
| | | |
| | | |
| | | cols = endx - startx + 1; |
| | | |
| | | |
| | | |
| | | //查找小数点 |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[6]; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | if (temp[2] > 0) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | unsigned char t = temp[0] + temp[1] + temp[3] + temp[4] + temp[5]; |
| | | if (t == 0) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = num_end; |
| | | nps[7] = endy; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //价格 |
| | | else if (type == 2) { |
| | | //股价 |
| | | |
| | | //printf("startx:%d starty:%d endx:%d endy:%d\n",startx,starty,endx,endy); |
| | | |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[6]; |
| | | int i; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | if (temp[2] > 0) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | unsigned char t = temp[0] + temp[1] + temp[3] + temp[4] + temp[5]; |
| | | if (t == 0) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = endx; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | |
| | | } |
| | | //代码与数字 |
| | | else if (type == 3 || type == 4) { |
| | | //手数 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = endx; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | //分隔数据 |
| | | |
| | | //最大分割20个数 |
| | | int numCount = 0; |
| | | //记录分割得到的数据 |
| | | int numberCols[20 * 2]; |
| | | |
| | | int i; |
| | | for (i = 0;i < 3;i++) { |
| | | if (nps[i * 4] == -1) { |
| | | break; |
| | | } |
| | | int _startx = nps[i * 4]; |
| | | int _starty = nps[i * 4 + 1]; |
| | | int _endx = nps[i * 4 + 2]; |
| | | int _endy = nps[i * 4 + 3]; |
| | | int _cols = _endx - _startx + 1; |
| | | |
| | | |
| | | |
| | | int c, startC = -1, endC = -1; |
| | | for (c = 0;c < _cols;c++) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = _starty;y <= _endy;y++) { |
| | | unsigned char value = get_binary_value(img_in[get_one_level_position(width, _startx + c, y)]); |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (empty) { |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | startC = -1; |
| | | endC = -1; |
| | | } |
| | | else { |
| | | if (startC == -1) { |
| | | startC = c; |
| | | endC = c; |
| | | } |
| | | else { |
| | | endC = c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | } |
| | | |
| | | int zeroCount = length_per_num - numCount; |
| | | //最大为20位数 |
| | | int fresult[20 * 2]; |
| | | for (i = 0;i < zeroCount;i++) { |
| | | fresult[i * 2] = -1; |
| | | fresult[i * 2 + 1] = -1; |
| | | } |
| | | |
| | | for (i = 0;i < numCount;i++) { |
| | | fresult[(i + zeroCount) * 2] = numberCols[i * 2]; |
| | | fresult[(i + zeroCount) * 2 + 1] = numberCols[i * 2 + 1]; |
| | | } |
| | | |
| | | //开始填充数据 |
| | | for (i = 0;i < length_per_num;i++) { |
| | | |
| | | unsigned char numData[100 * 100]; |
| | | |
| | | if (fresult[i * 2] == -1) { |
| | | //填充0 |
| | | for (int r = 0;r < num_height;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = get_binary_value(zero[r * num_width + c]); |
| | | //设置输出坐标的值 |
| | | numData[r * num_width + c] = value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else { |
| | | int _startx = fresult[i * 2]; |
| | | int _endx = fresult[i * 2 + 1]; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = 0; |
| | | if (_startx + c <= _endx) { |
| | | //填充空白0 |
| | | value = get_binary_value(img_in[get_one_level_position(width, _startx + c, r)]); |
| | | //设置输出坐标的值 |
| | | numData[(r - starty) * num_width + c] = value; |
| | | } |
| | | else { |
| | | numData[(r - starty) * num_width + c] = 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int rowDataCount = num_height * num_width * 10 * num_count; |
| | | int rowIndex = index / ele_count_per_line; |
| | | int index_0 = rowDataCount * rowIndex; |
| | | //行偏移量 |
| | | int index_2 = (num_width * 10) * (length_per_num * (index % ele_count_per_line) + i); |
| | | |
| | | for (int re = 0;re < 10;re++) { |
| | | int index_3 = re * num_width; |
| | | for (int r = 0;r < num_height;r++) { |
| | | int index_1 = r * (num_width * 10 * num_count); |
| | | for (int c = 0;c < num_width;c++) { |
| | | int findex = index_0 + index_1 + index_2 + index_3 + c; |
| | | //printf("index:%d-findex:%d value:%d \n", index, findex, numData[r * num_width + c]); |
| | | result[findex] = numData[r * num_width + c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //printf("\n"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //分割L2数字 |
| | | |
| | | __kernel void split_l2_num(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, int width, int num_width, int num_height, int num_count, |
| | | __global unsigned char* result) { |
| | | |
| | | int index = get_global_id(0); |
| | | //区域坐标 |
| | | int startP = index * 4; |
| | | int startx = pos_in[startP]; |
| | | int starty = pos_in[startP + 1]; |
| | | int endx = pos_in[startP + 2]; |
| | | int endy = pos_in[startP + 3]; |
| | | |
| | | if (startx > 0) |
| | | { |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | } |
| | | int cols = endx - startx + 1; |
| | | int rows = endy - starty + 1; |
| | | |
| | | int nps[12]; |
| | | if (index % 4 == 0) { |
| | | //时间 |
| | | int s = cols / 2; |
| | | int i; |
| | | //往前查找冒号 |
| | | int m1_s = -1, m1_e = -1, m2_s = -1, m2_e = -1; |
| | | uchar temp[7]; |
| | | for (i = s;i > -1;i--) { |
| | | if (i < 6) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i - 1, endy)]); |
| | | |
| | | |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i - 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i - 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i - 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m1_s = i - 6; |
| | | m1_e = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //往后查找冒号 |
| | | |
| | | for (i = s;i < cols;i++) { |
| | | if (i > cols - 6) { |
| | | break; |
| | | } |
| | | |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m2_s = i; |
| | | m2_e = i + 6; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | //printf("未查找到冒号:m1_s:%d m1_end:%d m2_s:%d m2_e:%d\n", m1_s, m1_e, m2_s, m2_e); |
| | | return; |
| | | } |
| | | |
| | | //3个时间的坐标 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m1_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m1_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = startx + m2_s - 1; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = startx + m2_e + 1; |
| | | nps[9] = starty; |
| | | nps[10] = endx; |
| | | nps[11] = endy; |
| | | |
| | | } |
| | | else if (index % 4 == 1) { |
| | | if (startx > 0 && endx > 0) { |
| | | //分隔s/m/h |
| | | int emptyX = -1; |
| | | for (int x = endx;x >= startx;x--) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y <= endy;y++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | emptyX = x; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (emptyX > 0) { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = emptyX - 1; |
| | | nps[3] = endy; |
| | | } |
| | | else { |
| | | //printf("撤单时间未解析到分隔符:%d", index); |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | } |
| | | } |
| | | else { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | } |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | |
| | | } |
| | | |
| | | else if (index % 4 == 2) { |
| | | //股价 |
| | | |
| | | //printf("startx:%d starty:%d endx:%d endy:%d\n",startx,starty,endx,endy); |
| | | |
| | | //往前查找小数点 |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[6]; |
| | | int i; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | if (temp[2] > 0) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | unsigned char t = temp[0] + temp[1] + temp[3] + temp[4] + temp[5]; |
| | | if (t == 0) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | //throw("未查找到小数点"); |
| | | //printf("未查找到小数点 m_s:%d m_e:%d\n", m_s,m_e); |
| | | return; |
| | | } |
| | | |
| | | |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = endx; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | } |
| | | |
| | | else if (index % 4 == 3) { |
| | | //手数 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = endx; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | //分隔数据 |
| | | |
| | | //最大分割6个数 |
| | | int numCount = 0; |
| | | //记录分割得到的数据 |
| | | int numberCols[12]; |
| | | |
| | | int i; |
| | | for (i = 0;i < 3;i++) { |
| | | if (nps[i * 4] == -1) { |
| | | break; |
| | | } |
| | | int _startx = nps[i * 4]; |
| | | int _starty = nps[i * 4 + 1]; |
| | | int _endx = nps[i * 4 + 2]; |
| | | int _endy = nps[i * 4 + 3]; |
| | | int _cols = _endx - _startx + 1; |
| | | |
| | | |
| | | |
| | | int c, startC = -1, endC = -1; |
| | | for (c = 0;c < _cols;c++) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = _starty;y <= _endy;y++) { |
| | | unsigned char value = get_binary_value(img_in[get_one_level_position(width, _startx + c, y)]); |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (empty) { |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | startC = -1; |
| | | endC = -1; |
| | | } |
| | | else { |
| | | if (startC == -1) { |
| | | startC = c; |
| | | endC = c; |
| | | } |
| | | else { |
| | | endC = c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | int maxNumberCount = 6; |
| | | if (index % 4 == 3) |
| | | { |
| | | maxNumberCount = 5; |
| | | } |
| | | else if (index % 4 == 1) { |
| | | maxNumberCount = 2; |
| | | } |
| | | |
| | | int zeroCount = maxNumberCount - numCount; |
| | | |
| | | int fresult[6 * 2]; |
| | | for (i = 0;i < zeroCount;i++) { |
| | | fresult[i * 2] = -1; |
| | | fresult[i * 2 + 1] = -1; |
| | | } |
| | | |
| | | for (i = 0;i < numCount;i++) { |
| | | fresult[(i + zeroCount) * 2] = numberCols[i * 2]; |
| | | fresult[(i + zeroCount) * 2 + 1] = numberCols[i * 2 + 1]; |
| | | } |
| | | |
| | | //开始填充数据 |
| | | for (i = 0;i < maxNumberCount;i++) { |
| | | |
| | | unsigned char numData[100 * 100]; |
| | | |
| | | if (fresult[i * 2] == -1) { |
| | | //填充0 |
| | | for (int r = 0;r < num_height;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = get_binary_value(zero[r * num_width + c]); |
| | | //设置输出坐标的值 |
| | | numData[r * num_width + c] = value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else { |
| | | int _startx = fresult[i * 2]; |
| | | int _endx = fresult[i * 2 + 1]; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = 0; |
| | | if (_startx + c <= _endx) { |
| | | //填充空白0 |
| | | value = get_binary_value(img_in[get_one_level_position(width, _startx + c, r)]); |
| | | //设置输出坐标的值 |
| | | numData[(r - starty) * num_width + c] = value; |
| | | } |
| | | else { |
| | | numData[(r - starty) * num_width + c] = 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int rowData = num_height * num_width * 10 * num_count; |
| | | int rowIndex = index / 4; |
| | | int index_0 = rowData * rowIndex; |
| | | //设置坐标值 |
| | | int index_2 = 0; |
| | | if (index % 4 == 0) { |
| | | index_2 += num_width * 10 * i; |
| | | } |
| | | else if (index % 4 == 1) { |
| | | index_2 += (num_width * 10) * (6 + i); |
| | | } |
| | | else if (index % 4 == 2) { |
| | | index_2 += (num_width * 10) * (6 + 2 + i); |
| | | } |
| | | else { |
| | | index_2 += (num_width * 10) * (6 + 2 + 6 + i); |
| | | } |
| | | |
| | | for (int re = 0;re < 10;re++) { |
| | | int index_3 = re * num_width; |
| | | for (int r = 0;r < num_height;r++) { |
| | | int index_1 = r * (num_width * 10 * num_count); |
| | | for (int c = 0;c < num_width;c++) { |
| | | int findex = index_0 + index_1 + index_2 + index_3 + c; |
| | | //printf("index:%d-findex:%d \n",index, findex); |
| | | result[findex] = numData[r * num_width + c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //printf("\n"); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | int getNowSecondTime1() { |
| | | time_t timep; |
| | | time(&timep); |
| | | char tmp_h[64]; |
| | | strftime(tmp_h, sizeof(tmp_h), "%H", localtime(&timep)); |
| | | char tmp_m[64]; |
| | | strftime(tmp_m, sizeof(tmp_m), "%M", localtime(&timep)); |
| | | char tmp_s[64]; |
| | | strftime(tmp_s, sizeof(tmp_s), "%S", localtime(&timep)); |
| | | cout << string(tmp_h) << endl; |
| | | cout << string(tmp_m) << endl; |
| | | cout << string(tmp_s) << endl; |
| | | |
| | | return stoi(string(tmp_h)) * 3600 + stoi(string(tmp_m)) * 60 + stoi(string(tmp_s)); |
| | | } |
| | | |
| | | int main() { |
| | | cout << "开始程序" << endl; |
| | | |
| | |
| | | //Win32Util::keyboardNum("000333", 10); |
| | | ImgUtil::init(); |
| | | |
| | | //int result= getNowSecondTime1(); |
| | | |
| | | |
| | | TradeListCapture* tradeListCapture = new TradeListCapture(); |
| | | tradeListCapture->init(NULL,NULL,NULL); |
| | | tradeListCapture->refreshTradeDelegateHWND(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //TradeListCapture* tradeListCapture = new TradeListCapture(); |
| | | //tradeListCapture->init(NULL,NULL,NULL); |
| | | //tradeListCapture->refreshTradeDelegateHWND(); |
| | | |
| | | |
| | | //cv::Mat img= tradeListCapture->grayImgs(CaptureUtil::capture(HWND(0x00055B0E))); |
| | | //cv::imwrite("C:\\Users\\Administrator\\Desktop\\ocr\\trade\\gray_1.png",img); |
| | | |
| | | list<TradeDelegateData> dataList = tradeListCapture->captureTradeDelegateInfo(); |
| | | //list<TradeDelegateData> dataList = tradeListCapture->captureTradeDelegateInfo(); |
| | | return 0; |
| | | |
| | | ImgUtil::init(); |
New file |
| | |
| | | |
| | | int get_one_level_position(int width, int x, int y) { |
| | | return width * y + x; |
| | | } |
| | | |
| | | unsigned char get_binary_value(unsigned char v) { |
| | | return v >= 64 ? 1 : 0; |
| | | } |
| | | |
| | | __kernel void split_l2_num(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, int width, int num_width, int num_height, int num_count, |
| | | __global unsigned char* result) { |
| | | |
| | | int index = get_global_id(0); |
| | | //区域坐标 |
| | | int startP = index * 4; |
| | | int startx = pos_in[startP]; |
| | | int starty = pos_in[startP + 1]; |
| | | int endx = pos_in[startP + 2]; |
| | | int endy = pos_in[startP + 3]; |
| | | |
| | | if (startx > 0) |
| | | { |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | } |
| | | int cols = endx - startx + 1; |
| | | int rows = endy - starty + 1; |
| | | |
| | | int nps[12]; |
| | | if (index % 4 == 0) { |
| | | |
| | | //时间 |
| | | int s = cols / 2; |
| | | int i; |
| | | //往前查找冒号 |
| | | int m1_s = -1, m1_e = -1, m2_s = -1, m2_e = -1; |
| | | unsigned char temp[7]; |
| | | for (i = s;i > -1;i--) { |
| | | if (i < 6) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i - 1, endy)]); |
| | | |
| | | |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i - 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i - 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i - 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m1_s = i - 6; |
| | | m1_e = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //往后查找冒号 |
| | | |
| | | for (i = s;i < cols;i++) { |
| | | if (i > cols - 6) { |
| | | break; |
| | | } |
| | | |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m2_s = i; |
| | | m2_e = i + 6; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | printf("未查找到冒号:m1_s:%d m1_end:%d m2_s:%d m2_e:%d\n", m1_s, m1_e, m2_s, m2_e); |
| | | return; |
| | | } |
| | | |
| | | //3个时间的坐标 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m1_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m1_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = startx + m2_s - 1; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = startx + m2_e + 1; |
| | | nps[9] = starty; |
| | | nps[10] = endx; |
| | | nps[11] = endy; |
| | | |
| | | |
| | | } |
| | | else if (index % 4 == 1) { |
| | | if (startx > 0 && endx > 0) { |
| | | //分隔s/m/h |
| | | int emptyX = -1; |
| | | for (int x = endx;x >= startx;x--) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y <= endy;y++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | emptyX = x; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (emptyX > 0) { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = emptyX - 1; |
| | | nps[3] = endy; |
| | | } |
| | | else { |
| | | //printf("撤单时间未解析到分隔符:%d", index); |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | } |
| | | } |
| | | else { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | } |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | |
| | | } |
| | | |
| | | else if (index % 4 == 2) { |
| | | //股价 |
| | | |
| | | //printf("startx:%d starty:%d endx:%d endy:%d\n",startx,starty,endx,endy); |
| | | |
| | | //往前查找小数点 |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[6]; |
| | | int i; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | if (temp[2] > 0) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | unsigned char t = temp[0] + temp[1] + temp[3] + temp[4] + temp[5]; |
| | | if (t == 0) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | //throw("未查找到小数点"); |
| | | //printf("未查找到小数点 m_s:%d m_e:%d\n", m_s,m_e); |
| | | return; |
| | | } |
| | | |
| | | |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = endx; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | } |
| | | |
| | | else if (index % 4 == 3) { |
| | | //手数 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = endx; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | |
| | | |
| | | //分隔数据 |
| | | //最大分割6个数 |
| | | int numCount = 0; |
| | | //记录分割得到的数据 |
| | | int numberCols[12]; |
| | | |
| | | int i; |
| | | /* |
| | | for (i = 0;i < 3;i++) { |
| | | if (nps[i * 4] == -1) { |
| | | break; |
| | | } |
| | | int _startx = nps[i * 4]; |
| | | int _starty = nps[i * 4 + 1]; |
| | | int _endx = nps[i * 4 + 2]; |
| | | int _endy = nps[i * 4 + 3]; |
| | | int _cols = _endx - _startx + 1; |
| | | |
| | | |
| | | |
| | | int c, startC = -1, endC = -1; |
| | | for (c = 0;c < _cols;c++) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = _starty;y <= _endy;y++) { |
| | | unsigned char value = get_binary_value(img_in[get_one_level_position(width, _startx + c, y)]); |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (empty) { |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | startC = -1; |
| | | endC = -1; |
| | | } |
| | | else { |
| | | if (startC == -1) { |
| | | startC = c; |
| | | endC = c; |
| | | } |
| | | else { |
| | | endC = c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | */ |
| | | int maxNumberCount = 6; |
| | | if (index % 4 == 3) |
| | | { |
| | | maxNumberCount = 5; |
| | | } |
| | | else if (index % 4 == 1) { |
| | | maxNumberCount = 2; |
| | | } |
| | | |
| | | int zeroCount = maxNumberCount - numCount; |
| | | |
| | | int fresult[6 * 2]; |
| | | for (i = 0;i < zeroCount;i++) { |
| | | fresult[i * 2] = -1; |
| | | fresult[i * 2 + 1] = -1; |
| | | } |
| | | |
| | | for (i = 0;i < numCount;i++) { |
| | | fresult[(i + zeroCount) * 2] = numberCols[i * 2]; |
| | | fresult[(i + zeroCount) * 2 + 1] = numberCols[i * 2 + 1]; |
| | | } |
| | | |
| | | //开始填充数据 |
| | | for (i = 0;i < maxNumberCount;i++) { |
| | | |
| | | unsigned char numData[100 * 100]; |
| | | |
| | | if (fresult[i * 2] == -1) { |
| | | //填充0 |
| | | for (int r = 0;r < num_height;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = get_binary_value(zero[r * num_width + c]); |
| | | //设置输出坐标的值 |
| | | numData[r * num_width + c] = value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else { |
| | | int _startx = fresult[i * 2]; |
| | | int _endx = fresult[i * 2 + 1]; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = 0; |
| | | if (_startx + c <= _endx) { |
| | | //填充空白0 |
| | | value = get_binary_value(img_in[get_one_level_position(width, _startx + c, r)]); |
| | | //设置输出坐标的值 |
| | | numData[(r - starty) * num_width + c] = value; |
| | | } |
| | | else { |
| | | numData[(r - starty) * num_width + c] = 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int rowData = num_height * num_width * 10 * num_count; |
| | | int rowIndex = index / 4; |
| | | int index_0 = rowData * rowIndex; |
| | | //设置坐标值 |
| | | int index_2 = 0; |
| | | if (index % 4 == 0) { |
| | | index_2 += num_width * 10 * i; |
| | | } |
| | | else if (index % 4 == 1) { |
| | | index_2 += (num_width * 10) * (6 + i); |
| | | } |
| | | else if (index % 4 == 2) { |
| | | index_2 += (num_width * 10) * (6 + 2 + i); |
| | | } |
| | | else { |
| | | index_2 += (num_width * 10) * (6 + 2 + 6 + i); |
| | | } |
| | | |
| | | for (int re = 0;re < 10;re++) { |
| | | int index_3 = re * num_width; |
| | | for (int r = 0;r < num_height;r++) { |
| | | int index_1 = r * (num_width * 10 * num_count); |
| | | for (int c = 0;c < num_width;c++) { |
| | | int findex = index_0 + index_1 + index_2 + index_3 + c; |
| | | //printf("index:%d-findex:%d \n",index, findex); |
| | | result[findex] = numData[r * num_width + c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //printf("\n"); |
| | | } |
| | |
| | | "VSVersion" = "3:800" |
| | | "ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" |
| | | "IsWebType" = "8:FALSE" |
| | | "ProjectName" = "8:Setup1" |
| | | "ProjectName" = "8:Setup" |
| | | "LanguageId" = "3:2052" |
| | | "CodePage" = "3:936" |
| | | "UILanguageId" = "3:2052" |
| | |
| | | "SccProvider" = "8:" |
| | | "Hierarchy" |
| | | { |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_03A66056D7F847B69907C6D698457F79" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_0BCC506D5D2E4AA5BC6A586A6B623FD0" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_0D533BDCE4DC4542BDE29E4086CED9DF" |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_10D906F07AB4E6C9AD91FA43E1CE3341" |
| | | "OwnerKey" = "8:_33C1D8724B6F4CAB8E73371F11AE6CEF" |
| | | "MsmKey" = "8:_10DAB6E29BE24673B2B1F29E18D5F103" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_13785C5CD1AF457EB63AAA997C163063" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_1457FAF31A5A4E16A162977981CECAAB" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_14F17E2B87D34ED49D65115B6DC39371" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_156E2EDCE05A46C5B874ECE8830FFB48" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_166A0582EF2547BF8AEF84EBC6276A3F" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_19C4724C5DF045799642148C845EFEE8" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_1C775FD143714EF99EAC75FF1ABEE7FC" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_1D3BFF14AA9F40DA8CD8603B71A9C753" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_1F51A9D36B82444B8347D23DA6B906C1" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_1F758F152EC9425BB99757C9B6EEDCBE" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_1FB82C66F472458BA53DED5FB26C2D69" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_33C1D8724B6F4CAB8E73371F11AE6CEF" |
| | | "MsmKey" = "8:_27D02F9E93154FAB84CABDA62A56B4DD" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_293D7B26E72040739D8C2AB04B86CDD9" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_2BBED7C6B7924AF9A41342BE6D39C8B4" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_32EEB56956A7477193D440E7C7B3C935" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_37CCD9E9378648F7BF39872598846F03" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_389656302A8841058999EAC095150EB4" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_39486290F0F04005883B24EDDDBAB9B4" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_3AD9003AED164569B847ADC000C2F933" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_41545C03CE1E472588B034418001A6F9" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_459F490270AF4E4C862B83D919BB5ACB" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_4BA9AE6CC82248E8A42244CE2E5D502D" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_51AE140E0B3F4ACFB37CBFBADFA33A6E" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_523CD36F57744BB69AA46EE29102E328" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_53EC8316F4D14272BE551BF183A15FFD" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_541AA175F0D44D8483F21A43B2C9E235" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_5B9019C61E8BF62BE8F821754805C91A" |
| | | "OwnerKey" = "8:_33C1D8724B6F4CAB8E73371F11AE6CEF" |
| | | "MsmKey" = "8:_58C99773E1AD4178A3E138C04923B5AF" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_5B5B699ECC7443B7B57F656F38BDF94F" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_6272415026E64E438E780AA8D5A8F1E6" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_63B97A73AD62463AA59583710FB81A3A" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_66A4E168E8EE4DF4B7D24A34A083BD94" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_66ACAD4179D84330820EB57A14BED475" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_698FBE0A760145A79D43A539B32FA846" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_69C4E5DC19A344929265E05D11B771C0" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_77ADD71DC6D24C64AE8944A34E5D8208" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_8290D92AAC2A4A62B3F1C8CA90E659D4" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_83474D60E279483F8A624ED10516D693" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_8604DE458C7A48DD9DB3A55699906B6D" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_88E7511A43901EA2B6A0F12EFF6661FE" |
| | | "OwnerKey" = "8:_33C1D8724B6F4CAB8E73371F11AE6CEF" |
| | | "MsmKey" = "8:_880A95B3F98244A796BDF1F9FAABC4AF" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_8BA2EE00CDA44A86A04012400338FA36" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_8BA7A09CAC1F4A6E893700AEAD0C2857" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_8E4E4B3B48AB473AB0C34F72CF6F04A3" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_92F72FA0D4344F3996C6CA107F63BFDD" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_952B9190D922496A89106A68A0A0CB70" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_95CE406A36A94CDA864E3202185AC392" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_975AFD48C3234909A7C55CB618768B39" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_A97D149608C6FC6837656B6A20636018" |
| | | "OwnerKey" = "8:_33C1D8724B6F4CAB8E73371F11AE6CEF" |
| | | "MsmKey" = "8:_9F3233703A954EE88859625810DE3118" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_A092AE06B3964AB394D4A282B2ACF219" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_A1064D14908E4132A62C92B9336C2A6D" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_A313EDE7F41E463D9F127A5BE602DB72" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_A3D2B74313534263980149C153E26C06" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_A8E575E49C23473180CA89D8897DC52A" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_A9D69F6D34424ADDAC1AC5C61C9F79B1" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_AA7B789D00774C78A92BD473EE724A3F" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_AE34DBC834BB4449BBC2B271E254C7A6" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_B2A53CD718FC49BAAC3AA7A7C7173330" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_B72408B73B7D4DF4A4B010F2A8CADFE2" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_B8EC08A95DDE423A91FB93AD963E25F0" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_BA75A8E7417B4D2EA41274186453503B" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_BDF45CC6F35B4A80A6DA3C88083D6C92" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_C66FAF78BCF6A56F539A77AFF5C1932B" |
| | | "OwnerKey" = "8:_33C1D8724B6F4CAB8E73371F11AE6CEF" |
| | | "MsmKey" = "8:_C7C1C085C13845D8B18DA16130AD9DBD" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_CAA83BFE656C4DEE92C5FA9C8A099012" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_CCEEA769D74D4C24A4C426A652738CBC" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_CE3165F159BD444EB6FEB75773FB3DF8" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_CF2B6FC9DE3143E884E0FBFB21C5849E" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_D39D52A0485A43C1A8A86F32A14CF1D9" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_D8865CD9923A459A9A6208F38F20CDCD" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_DEF89616C91048DB889B12773A35E84A" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_E72FB07732A54E12BE0DB73689193EF4" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_E837B89B86A143FD8AFAB33B1969A639" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_E9520286FB624C42AD695E7E81B46501" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_E95EE092B9DC40CFB723DF89798C1755" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_F1007E35917C4814A20D5A0CAEF3C6E2" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_F4A95DC6430040D8A62247176291B48C" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_F5497F471C664DF4975FAA7C180566E5" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_F822A8A90E9545F281B4F27E204428FD" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_FA92B955F2334A03932EDD161CEA8548" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | | "Entry" |
| | | { |
| | | "MsmKey" = "8:_FD3FE5288CB540D3B47BEEECF353DEEE" |
| | | "OwnerKey" = "8:_UNDEFINED" |
| | | "MsmSig" = "8:_UNDEFINED" |
| | | } |
| | |
| | | "DisplayName" = "8:Debug" |
| | | "IsDebugOnly" = "11:TRUE" |
| | | "IsReleaseOnly" = "11:FALSE" |
| | | "OutputFilename" = "8:Debug\\Setup1.msi" |
| | | "OutputFilename" = "8:Debug\\gp.msi" |
| | | "PackageFilesAs" = "3:2" |
| | | "PackageFileSize" = "3:-2147483648" |
| | | "CabType" = "3:1" |
| | | "Compression" = "3:2" |
| | | "Compression" = "3:1" |
| | | "SignOutput" = "11:FALSE" |
| | | "CertificateFile" = "8:" |
| | | "PrivateKeyFile" = "8:" |
| | |
| | | "PackageFilesAs" = "3:2" |
| | | "PackageFileSize" = "3:-2147483648" |
| | | "CabType" = "3:1" |
| | | "Compression" = "3:2" |
| | | "Compression" = "3:1" |
| | | "SignOutput" = "11:FALSE" |
| | | "CertificateFile" = "8:" |
| | | "PrivateKeyFile" = "8:" |
| | |
| | | } |
| | | "File" |
| | | { |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_03A66056D7F847B69907C6D698457F79" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\08.jpg" |
| | | "TargetName" = "8:08.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0BCC506D5D2E4AA5BC6A586A6B623FD0" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\14.jpg" |
| | | "TargetName" = "8:14.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0D533BDCE4DC4542BDE29E4086CED9DF" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\number\\4.jpg" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_10D906F07AB4E6C9AD91FA43E1CE3341" |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_10DAB6E29BE24673B2B1F29E18D5F103" |
| | | { |
| | | "SourcePath" = "8:VCRUNTIME140D.dll" |
| | | "TargetName" = "8:VCRUNTIME140D.dll" |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\57.jpg" |
| | | "TargetName" = "8:57.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_13785C5CD1AF457EB63AAA997C163063" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\mfc140ud.dll" |
| | | "TargetName" = "8:mfc140ud.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:TRUE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1457FAF31A5A4E16A162977981CECAAB" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\21.jpg" |
| | | "TargetName" = "8:21.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_14F17E2B87D34ED49D65115B6DC39371" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\24.jpg" |
| | | "TargetName" = "8:24.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_156E2EDCE05A46C5B874ECE8830FFB48" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\vcruntime140_1d.dll" |
| | | "TargetName" = "8:vcruntime140_1d.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_166A0582EF2547BF8AEF84EBC6276A3F" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\38.jpg" |
| | | "TargetName" = "8:38.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_19C4724C5DF045799642148C845EFEE8" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\06.jpg" |
| | | "TargetName" = "8:06.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1C775FD143714EF99EAC75FF1ABEE7FC" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\10.jpg" |
| | | "TargetName" = "8:10.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1D3BFF14AA9F40DA8CD8603B71A9C753" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\42.jpg" |
| | | "TargetName" = "8:42.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1F51A9D36B82444B8347D23DA6B906C1" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\53.jpg" |
| | | "TargetName" = "8:53.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1F758F152EC9425BB99757C9B6EEDCBE" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\52.jpg" |
| | | "TargetName" = "8:52.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1FB82C66F472458BA53DED5FB26C2D69" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\49.jpg" |
| | | "TargetName" = "8:49.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2218F7C9B926477DA2430B963075D913" |
| | |
| | | "TargetName" = "8:8.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_BB92469622F74DDAB8178CC7573846B4" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_27D02F9E93154FAB84CABDA62A56B4DD" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\vcruntime140d.dll" |
| | | "TargetName" = "8:vcruntime140d.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_293D7B26E72040739D8C2AB04B86CDD9" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\ucrtbased.dll" |
| | | "TargetName" = "8:ucrtbased.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2BBED7C6B7924AF9A41342BE6D39C8B4" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\01.jpg" |
| | | "TargetName" = "8:01.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_32EEB56956A7477193D440E7C7B3C935" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\20.jpg" |
| | | "TargetName" = "8:20.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_37CCD9E9378648F7BF39872598846F03" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\33.jpg" |
| | | "TargetName" = "8:33.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_389656302A8841058999EAC095150EB4" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\27.jpg" |
| | | "TargetName" = "8:27.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_39486290F0F04005883B24EDDDBAB9B4" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\22.jpg" |
| | | "TargetName" = "8:22.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_3AD9003AED164569B847ADC000C2F933" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\number\\8.jpg" |
| | | "TargetName" = "8:8.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_6BAF7DBFA9254068870E2F9A5C1B6FA6" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_41545C03CE1E472588B034418001A6F9" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\25.jpg" |
| | | "TargetName" = "8:25.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_459F490270AF4E4C862B83D919BB5ACB" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\12.jpg" |
| | | "TargetName" = "8:12.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4BA9AE6CC82248E8A42244CE2E5D502D" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\44.jpg" |
| | | "TargetName" = "8:44.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_51AE140E0B3F4ACFB37CBFBADFA33A6E" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\11.jpg" |
| | | "TargetName" = "8:11.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_523CD36F57744BB69AA46EE29102E328" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\07.jpg" |
| | | "TargetName" = "8:07.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_53EC8316F4D14272BE551BF183A15FFD" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\56.jpg" |
| | | "TargetName" = "8:56.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_541AA175F0D44D8483F21A43B2C9E235" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\00.jpg" |
| | | "TargetName" = "8:00.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_5B9019C61E8BF62BE8F821754805C91A" |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_58C99773E1AD4178A3E138C04923B5AF" |
| | | { |
| | | "SourcePath" = "8:OpenCL.dll" |
| | | "TargetName" = "8:OpenCL.dll" |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\19.jpg" |
| | | "TargetName" = "8:19.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:TRUE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_5B5B699ECC7443B7B57F656F38BDF94F" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\54.jpg" |
| | | "TargetName" = "8:54.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_5F858163903B4EAFB20D4D7DA1EBCA58" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6272415026E64E438E780AA8D5A8F1E6" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\35.jpg" |
| | | "TargetName" = "8:35.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_63B97A73AD62463AA59583710FB81A3A" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\45.jpg" |
| | | "TargetName" = "8:45.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_66A4E168E8EE4DF4B7D24A34A083BD94" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\msvcp140d.dll" |
| | | "TargetName" = "8:msvcp140d.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_66ACAD4179D84330820EB57A14BED475" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\28.jpg" |
| | | "TargetName" = "8:28.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_698FBE0A760145A79D43A539B32FA846" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\number\\3.jpg" |
| | | "TargetName" = "8:3.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_6BAF7DBFA9254068870E2F9A5C1B6FA6" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_69C4E5DC19A344929265E05D11B771C0" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\OpenCL.dll" |
| | | "TargetName" = "8:OpenCL.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_77ADD71DC6D24C64AE8944A34E5D8208" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\13.jpg" |
| | | "TargetName" = "8:13.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8290D92AAC2A4A62B3F1C8CA90E659D4" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\51.jpg" |
| | | "TargetName" = "8:51.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_83474D60E279483F8A624ED10516D693" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\29.jpg" |
| | | "TargetName" = "8:29.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8604DE458C7A48DD9DB3A55699906B6D" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\37.jpg" |
| | | "TargetName" = "8:37.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_88E7511A43901EA2B6A0F12EFF6661FE" |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_880A95B3F98244A796BDF1F9FAABC4AF" |
| | | { |
| | | "SourcePath" = "8:opencv_world455d.dll" |
| | | "TargetName" = "8:opencv_world455d.dll" |
| | | "SourcePath" = "8:..\\dependency\\msvcr100.dll" |
| | | "TargetName" = "8:msvcr100.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:TRUE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8BA2EE00CDA44A86A04012400338FA36" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\47.jpg" |
| | | "TargetName" = "8:47.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8BA7A09CAC1F4A6E893700AEAD0C2857" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\18.jpg" |
| | | "TargetName" = "8:18.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8E4E4B3B48AB473AB0C34F72CF6F04A3" |
| | | { |
| | | "SourcePath" = "8:..\\ConsoleApplication\\kernel.cl" |
| | | "TargetName" = "8:kernel.cl" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_92F72FA0D4344F3996C6CA107F63BFDD" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\comdlg32.dll" |
| | | "TargetName" = "8:comdlg32.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_952B9190D922496A89106A68A0A0CB70" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\50.jpg" |
| | | "TargetName" = "8:50.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_95CE406A36A94CDA864E3202185AC392" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\17.jpg" |
| | | "TargetName" = "8:17.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_975AFD48C3234909A7C55CB618768B39" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\05.jpg" |
| | | "TargetName" = "8:05.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9C2903892F75438A93E871FCBEE63F64" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A97D149608C6FC6837656B6A20636018" |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9F3233703A954EE88859625810DE3118" |
| | | { |
| | | "SourcePath" = "8:ucrtbased.dll" |
| | | "TargetName" = "8:ucrtbased.dll" |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\31.jpg" |
| | | "TargetName" = "8:31.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A092AE06B3964AB394D4A282B2ACF219" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\pthreadVC2.dll" |
| | | "TargetName" = "8:pthreadVC2.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:TRUE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A1064D14908E4132A62C92B9336C2A6D" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\16.jpg" |
| | | "TargetName" = "8:16.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A313EDE7F41E463D9F127A5BE602DB72" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\55.jpg" |
| | | "TargetName" = "8:55.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A3D2B74313534263980149C153E26C06" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\48.jpg" |
| | | "TargetName" = "8:48.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A8E575E49C23473180CA89D8897DC52A" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\03.jpg" |
| | | "TargetName" = "8:03.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A9D69F6D34424ADDAC1AC5C61C9F79B1" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\40.jpg" |
| | | "TargetName" = "8:40.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_AA7B789D00774C78A92BD473EE724A3F" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\04.jpg" |
| | | "TargetName" = "8:04.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_AE34DBC834BB4449BBC2B271E254C7A6" |
| | |
| | | "TargetName" = "8:3.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_BB92469622F74DDAB8178CC7573846B4" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B2A53CD718FC49BAAC3AA7A7C7173330" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\39.jpg" |
| | | "TargetName" = "8:39.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B72408B73B7D4DF4A4B010F2A8CADFE2" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\23.jpg" |
| | | "TargetName" = "8:23.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B8EC08A95DDE423A91FB93AD963E25F0" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\34.jpg" |
| | | "TargetName" = "8:34.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_BA75A8E7417B4D2EA41274186453503B" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\number\\2.jpg" |
| | | "TargetName" = "8:2.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_6BAF7DBFA9254068870E2F9A5C1B6FA6" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_BDF45CC6F35B4A80A6DA3C88083D6C92" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\02.jpg" |
| | | "TargetName" = "8:02.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C66FAF78BCF6A56F539A77AFF5C1932B" |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C7C1C085C13845D8B18DA16130AD9DBD" |
| | | { |
| | | "SourcePath" = "8:MSVCP140D.dll" |
| | | "TargetName" = "8:MSVCP140D.dll" |
| | | "SourcePath" = "8:..\\dependency\\concrt140d.dll" |
| | | "TargetName" = "8:concrt140d.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:TRUE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CAA83BFE656C4DEE92C5FA9C8A099012" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\09.jpg" |
| | | "TargetName" = "8:09.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CCEEA769D74D4C24A4C426A652738CBC" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\GdiPlus.dll" |
| | | "TargetName" = "8:GdiPlus.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CE3165F159BD444EB6FEB75773FB3DF8" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\46.jpg" |
| | | "TargetName" = "8:46.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CF2B6FC9DE3143E884E0FBFB21C5849E" |
| | | { |
| | | "SourcePath" = "8:..\\dependency\\opencv_world455d.dll" |
| | | "TargetName" = "8:opencv_world455d.dll" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CF6C4192145E4E3D89AE201DD90C0344" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D39D52A0485A43C1A8A86F32A14CF1D9" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\15.jpg" |
| | | "TargetName" = "8:15.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D8865CD9923A459A9A6208F38F20CDCD" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\number\\5.jpg" |
| | | "TargetName" = "8:5.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_6BAF7DBFA9254068870E2F9A5C1B6FA6" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_DEF89616C91048DB889B12773A35E84A" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\58.jpg" |
| | | "TargetName" = "8:58.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E72FB07732A54E12BE0DB73689193EF4" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\26.jpg" |
| | | "TargetName" = "8:26.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E9520286FB624C42AD695E7E81B46501" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\41.jpg" |
| | | "TargetName" = "8:41.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E95EE092B9DC40CFB723DF89798C1755" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\32.jpg" |
| | | "TargetName" = "8:32.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F1007E35917C4814A20D5A0CAEF3C6E2" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\43.jpg" |
| | | "TargetName" = "8:43.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F4A95DC6430040D8A62247176291B48C" |
| | | { |
| | | "SourcePath" = "8:D:\\Chrom\\icon.ico" |
| | | "TargetName" = "8:icon.ico" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F5497F471C664DF4975FAA7C180566E5" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\36.jpg" |
| | | "TargetName" = "8:36.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F822A8A90E9545F281B4F27E204428FD" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\number_2\\0.jpg" |
| | | "TargetName" = "8:0.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_BB92469622F74DDAB8178CC7573846B4" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_FA92B955F2334A03932EDD161CEA8548" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\59.jpg" |
| | | "TargetName" = "8:59.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | | "ReadOnly" = "11:FALSE" |
| | | "Hidden" = "11:FALSE" |
| | | "System" = "11:FALSE" |
| | | "Permanent" = "11:FALSE" |
| | | "SharedLegacy" = "11:FALSE" |
| | | "PackageAs" = "3:1" |
| | | "Register" = "3:1" |
| | | "Exclude" = "11:FALSE" |
| | | "IsDependency" = "11:FALSE" |
| | | "IsolateTo" = "8:" |
| | | } |
| | | "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_FD3FE5288CB540D3B47BEEECF353DEEE" |
| | | { |
| | | "SourcePath" = "8:C:\\Users\\Administrator\\Desktop\\ocr\\time\\30.jpg" |
| | | "TargetName" = "8:30.jpg" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_7BB808BC6552455197BD220399B4EB6B" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Vital" = "11:TRUE" |
| | |
| | | { |
| | | } |
| | | } |
| | | "{9EF0B969-E518-4E46-987F-47570745A589}:_7BB808BC6552455197BD220399B4EB6B" |
| | | { |
| | | "Name" = "8:time" |
| | | "AlwaysCreate" = "11:FALSE" |
| | | "Condition" = "8:" |
| | | "Transitive" = "11:FALSE" |
| | | "Property" = "8:_109FD88D10864F85AE80FD21607D850F" |
| | | "Folders" |
| | | { |
| | | } |
| | | } |
| | | "{9EF0B969-E518-4E46-987F-47570745A589}:_BB92469622F74DDAB8178CC7573846B4" |
| | | { |
| | | "Name" = "8:number_2" |
| | |
| | | "Product" |
| | | { |
| | | "Name" = "8:Microsoft Visual Studio" |
| | | "ProductName" = "8:Setup1" |
| | | "ProductName" = "8:GP" |
| | | "ProductCode" = "8:{AD2DB9B9-91FB-4E17-ABA5-8C2DB663ACE2}" |
| | | "PackageCode" = "8:{3E19DE8D-D11F-4C90-8773-3DFBCC841BEE}" |
| | | "PackageCode" = "8:{33D97017-BA1B-4775-922F-FE62DB48947E}" |
| | | "UpgradeCode" = "8:{746B406D-2250-4EC9-AC73-44489EBE2279}" |
| | | "AspNetVersion" = "8:2.0.50727.0" |
| | | "RestartWWWService" = "11:FALSE" |
| | |
| | | "Manufacturer" = "8:yeshi" |
| | | "ARPHELPTELEPHONE" = "8:" |
| | | "ARPHELPLINK" = "8:" |
| | | "Title" = "8:Setup1" |
| | | "Title" = "8:GP" |
| | | "Subject" = "8:" |
| | | "ARPCONTACT" = "8:hxh" |
| | | "Keywords" = "8:" |
| | |
| | | } |
| | | "Shortcut" |
| | | { |
| | | "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_C34374EF94A44388A0B275AEDDF1D89B" |
| | | { |
| | | "Name" = "8:GP" |
| | | "Arguments" = "8:" |
| | | "Description" = "8:" |
| | | "ShowCmd" = "3:1" |
| | | "IconIndex" = "3:0" |
| | | "Transitive" = "11:FALSE" |
| | | "Target" = "8:_E837B89B86A143FD8AFAB33B1969A639" |
| | | "Folder" = "8:_1D9848B60CAE49C2A6DB49269F3C3801" |
| | | "WorkingFolder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | | "Icon" = "8:_F4A95DC6430040D8A62247176291B48C" |
| | | "Feature" = "8:" |
| | | } |
| | | } |
| | | "UserInterface" |
| | | { |
| | |
| | | } |
| | | "ProjectOutput" |
| | | { |
| | | "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_33C1D8724B6F4CAB8E73371F11AE6CEF" |
| | | "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_E837B89B86A143FD8AFAB33B1969A639" |
| | | { |
| | | "SourcePath" = "8:..\\x64\\Debug\\CaptureRec.exe" |
| | | "SourcePath" = "8:..\\x64\\Debug\\DataCapture.exe" |
| | | "TargetName" = "8:" |
| | | "Tag" = "8:" |
| | | "Folder" = "8:_ED2E18F7F28640CFB945EC6F442FEA76" |
| | |
| | | "ProjectOutputGroupRegister" = "3:1" |
| | | "OutputConfiguration" = "8:" |
| | | "OutputGroupCanonicalName" = "8:Built" |
| | | "OutputProjectGuid" = "8:{06EF9CE2-558F-4171-8F92-26C308D53203}" |
| | | "OutputProjectGuid" = "8:{205AA3B8-2E6C-478A-8E44-275B29315832}" |
| | | "ShowKeyOutput" = "11:TRUE" |
| | | "ExcludeFilters" |
| | | { |
| | |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | static std::string loadHeartbeatData(int client) { |
| | | static std::string loadHeartbeatData(int client,string memery) { |
| | | Json::Value root; |
| | | root["type"] = 30; |
| | | Json::Value data; |
| | | data["client"] = client; |
| | | data["memery"] = memery; |
| | | root["data"] = data; |
| | | return toJsonStr(root); |
| | | } |
| | |
| | | } |
| | | |
| | | void SocketManager::runSocketServer(void* context) { |
| | | //创建server |
| | | WSADATA wsaData; |
| | | WSAStartup(MAKEWORD(2, 2), &wsaData);//初始化 |
| | | socketServer = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
| | | sockaddr_in sockaddr; |
| | | sockaddr.sin_family = AF_INET; |
| | | sockaddr.sin_addr.S_un.S_addr = htonl(INADDR_ANY); |
| | | sockaddr.sin_port = htons(LOCAL_SERVER_PORT); |
| | | int result; |
| | | if (bind(socketServer, (const struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR) { |
| | | closesocket(socketServer); |
| | | WSACleanup(); |
| | | printf("绑定失败\n"); |
| | | return; |
| | | } |
| | | //在本地绑定端口 |
| | | result = listen(socketServer, SOMAXCONN);//开始监听 |
| | | |
| | | SocketManager* sm = (SocketManager*)context; |
| | | |
| | | |
| | | printf("wait for connection...\n"); |
| | | |
| | | |
| | | while (true) |
| | | //出错之后重新创建socket server |
| | | for (;;) |
| | | { |
| | | int nsize = sizeof(SOCKADDR); |
| | | SOCKADDR clientAddr; |
| | | SOCKET client = accept(sm->socketServer, &clientAddr, &nsize); |
| | | if (client == SOCKET_ERROR) |
| | | //创建server |
| | | WSADATA wsaData; |
| | | WSAStartup(MAKEWORD(2, 2), &wsaData);//初始化 |
| | | socketServer = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
| | | sockaddr_in sockaddr; |
| | | sockaddr.sin_family = AF_INET; |
| | | sockaddr.sin_addr.S_un.S_addr = htonl(INADDR_ANY); |
| | | sockaddr.sin_port = htons(LOCAL_SERVER_PORT); |
| | | int result; |
| | | if (bind(socketServer, (const struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR) { |
| | | closesocket(socketServer); |
| | | WSACleanup(); |
| | | printf("绑定失败\n"); |
| | | return; |
| | | } |
| | | //在本地绑定端口 |
| | | result = listen(socketServer, SOMAXCONN);//开始监听 |
| | | |
| | | SocketManager* sm = (SocketManager*)context; |
| | | |
| | | |
| | | printf("wait for connection...\n"); |
| | | |
| | | |
| | | while (true) |
| | | { |
| | | cout << "连接失败" << endl; |
| | | continue; |
| | | int nsize = sizeof(SOCKADDR); |
| | | SOCKADDR clientAddr; |
| | | SOCKET client = accept(sm->socketServer, &clientAddr, &nsize); |
| | | if (client == SOCKET_ERROR) |
| | | { |
| | | cout << "socket-server 连接失败:" << client << endl; |
| | | break; |
| | | } |
| | | |
| | | thread msg(SocketManager::processMsg, client, context); |
| | | msg.detach(); |
| | | } |
| | | |
| | | thread msg(SocketManager::processMsg, client, context); |
| | | msg.detach(); |
| | | closesocket(socketServer); |
| | | WSACleanup(); |
| | | //重新创建的时间间隔为2s |
| | | Sleep(2000); |
| | | } |
| | | |
| | | closesocket(socketServer); |
| | | WSACleanup(); |
| | | |
| | | } |
| | | |
| | |
| | | SetRegistryKey(_T("应用程序向导生成的本地应用程序")); |
| | | |
| | | loginDlg dlg; |
| | | dlg.setReLogin(false); |
| | | m_pMainWnd = &dlg; |
| | | INT_PTR nResponse = dlg.DoModal(); |
| | | if (nResponse == IDOK) |
| | |
| | | <ResourceCompile Include="app.rc" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <None Include="kernel.cl" /> |
| | | <None Include="packages.config" /> |
| | | <None Include="res\app.rc2" /> |
| | | </ItemGroup> |
| | |
| | | <ImportGroup Label="ExtensionTargets"> |
| | | <Import Project="..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets" Condition="Exists('..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets')" /> |
| | | <Import Project="..\packages\pthreads.2.9.1.4\build\native\pthreads.targets" Condition="Exists('..\packages\pthreads.2.9.1.4\build\native\pthreads.targets')" /> |
| | | <Import Project="..\packages\log4cpp.1.1.3.3\build\log4cpp.targets" Condition="Exists('..\packages\log4cpp.1.1.3.3\build\log4cpp.targets')" /> |
| | | </ImportGroup> |
| | | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
| | | <PropertyGroup> |
| | |
| | | </PropertyGroup> |
| | | <Error Condition="!Exists('..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\pthreads.redist.2.9.1.4\build\native\pthreads.redist.targets'))" /> |
| | | <Error Condition="!Exists('..\packages\pthreads.2.9.1.4\build\native\pthreads.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\pthreads.2.9.1.4\build\native\pthreads.targets'))" /> |
| | | <Error Condition="!Exists('..\packages\log4cpp.1.1.3.3\build\log4cpp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\log4cpp.1.1.3.3\build\log4cpp.targets'))" /> |
| | | </Target> |
| | | </Project> |
| | |
| | | <Filter>资源文件</Filter> |
| | | </None> |
| | | <None Include="packages.config" /> |
| | | <None Include="kernel.cl"> |
| | | <Filter>源文件</Filter> |
| | | </None> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Image Include="res\app.ico"> |
| | |
| | | |
| | | // appDlg.cpp: 实现文件 |
| | | // |
| | | |
| | | #include "pch.h" |
| | | #include "pch.h" |
| | | #include "framework.h" |
| | | #include "app.h" |
| | | #include "appDlg.h" |
| | |
| | | #include "THSActionUtil.h" |
| | | #include "NetWorkUtil.h" |
| | | #include "GUITool.h" |
| | | #include <direct.h> |
| | | #ifndef _TOOL_H |
| | | #define _TOOL_H 1 |
| | | #include "tool.h" |
| | |
| | | #ifdef _DEBUG |
| | | #define new DEBUG_NEW |
| | | #endif |
| | | #include <Win32Util.h> |
| | | #include "loginDlg.h" |
| | | |
| | | |
| | | // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 |
| | |
| | | // 实现 |
| | | protected: |
| | | DECLARE_MESSAGE_MAP() |
| | | public: |
| | | afx_msg void OnBnClickedCheck5(); |
| | | }; |
| | | |
| | | CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) |
| | |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) |
| | | |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | socketManager = new SocketManager(CappDlg::OnActionCallback, this); |
| | | RecognitionUtil::init(); |
| | | ImgUtil::init(); |
| | | //设置安装根路径 |
| | | char* rootpath; |
| | | if ((rootpath = _getcwd(NULL, 0)) == NULL) { |
| | | } |
| | | else { |
| | | string path = string(rootpath).append("\\"); |
| | | OpenCLExcuter::rootPath = path; |
| | | } |
| | | std::cout << "rootpath:" << rootpath << std::endl; |
| | | |
| | | |
| | | capture = new L2DataCapture(); |
| | | recognitionManager = new RecognitionManager(); |
| | | limitUpCapture = new LimitUpCapture(); |
| | |
| | | DDX_Control(pDX, IDC_BUTTON5, btnL2); |
| | | DDX_Control(pDX, IDC_BUTTON8, uploadGPBtn); |
| | | DDX_Control(pDX, IDC_BUTTON_TRADE_DELEGATE, delegateBtn); |
| | | DDX_Control(pDX, IDC_CHECK5, tradeTimeCaptureCheck); |
| | | DDX_Control(pDX, IDC_BUTTON22, refreshHWNDBtn); |
| | | DDX_Control(pDX, IDC_BUTTON21, resetTHSBtn); |
| | | DDX_Control(pDX, IDC_CHECK6, autoL2Check); |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CappDlg, CDialogEx) |
| | |
| | | ON_BN_CLICKED(IDC_BUTTON_TRADE, &CappDlg::OnBnClickedButtonTrade) |
| | | ON_BN_CLICKED(IDC_INDUSTRY, &CappDlg::OnBnClickedIndustry) |
| | | ON_BN_CLICKED(IDC_BUTTON_TRADE_DELEGATE, &CappDlg::OnBnClickedButtonTradeDelegate) |
| | | ON_BN_CLICKED(IDC_BUTTON_TEST, &CappDlg::OnBnClickedButtonTest) |
| | | ON_BN_CLICKED(IDC_CHECK5, &CappDlg::OnBnClickedCheck5) |
| | | ON_BN_CLICKED(IDC_BUTTON21, &CappDlg::OnBnClickedButton21) |
| | | ON_BN_CLICKED(IDC_BUTTON22, &CappDlg::OnBnClickedButton22) |
| | | ON_BN_CLICKED(IDC_LOGOUT_BTN, &CappDlg::OnBnClickedLogoutBtn) |
| | | ON_BN_CLICKED(IDC_CHECK6, &CappDlg::OnBnClickedCheck6) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | ((CButton*)GetDlgItem(IDC_CHECK2))->SetCheck(TRUE); |
| | | ((CButton*)GetDlgItem(IDC_CHECK3))->SetCheck(TRUE); |
| | | ((CButton*)GetDlgItem(IDC_CHECK4))->SetCheck(TRUE); |
| | | tradeTimeCaptureCheck.SetCheck(TRUE); |
| | | L2DataCapture::setTradeTimeCapture(true); |
| | | |
| | | |
| | | |
| | | |
| | | if (authoritySet.count(AUTHORITY_L2) > 0) { |
| | | btnL2.EnableWindow(TRUE); |
| | | resetTHSBtn.EnableWindow(TRUE); |
| | | refreshHWNDBtn.EnableWindow(TRUE); |
| | | list<string> settings= Tool::getSettings("setting.txt"); |
| | | if (settings.size() > 0) { |
| | | string c= *(settings.begin()); |
| | | if (c == "1") { |
| | | autoL2Check.SetCheck(TRUE); |
| | | thread rt(&(CappDlg::autoStartL2),this); |
| | | rt.detach(); |
| | | } |
| | | else { |
| | | autoL2Check.SetCheck(FALSE); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | btnL2.EnableWindow(FALSE); |
| | | resetTHSBtn.EnableWindow(FALSE); |
| | | refreshHWNDBtn.EnableWindow(FALSE); |
| | | } |
| | | |
| | | if (authoritySet.count(AUTHORITY_LIMIT_UP) > 0) { |
| | |
| | | |
| | | st.Format(_T("客户端ID:%s"), idStr); |
| | | GetDlgItem(IDC_STATIC3)->SetWindowTextW(st); |
| | | |
| | | if (!capture->isInited()) |
| | | { |
| | | try { |
| | | capture->init(OnL2DataCallback, OnTradeQueueDataCallback, this); |
| | | } |
| | | catch (string st) { |
| | | } |
| | | } |
| | | |
| | | //loginWin->DestroyWindow(); |
| | | //隐藏父窗口 |
| | |
| | | app->socketManager->resetClient(index); |
| | | app->socketManager->Connect(index); |
| | | } |
| | | cout << "*****数据处理时间:" << (clock() - time_start) << endl; |
| | | //cout << "*****数据处理时间:" << (clock() - time_start) << endl; |
| | | } |
| | | } |
| | | |
| | |
| | | app->socketManager->resetClient(index); |
| | | app->socketManager->Connect(index); |
| | | } |
| | | cout << "*****数据处理时间:" << (clock() - time_start) << endl; |
| | | //cout << "*****数据处理时间:" << (clock() - time_start) << endl; |
| | | } |
| | | } |
| | | |
| | |
| | | catch (string st) { |
| | | //重新连接服务器 |
| | | app->socketManager->resetClient(8); |
| | | app->socketManager->Connect(8); |
| | | app->socketManager->Connect(8); |
| | | } |
| | | |
| | | |
| | |
| | | cout << "action回调:" << std::this_thread::get_id() << ":" << data << endl; |
| | | //解析命令 |
| | | Json::Value root = JsonUtil::parseJson(data); |
| | | if (root["action"].asString() == "setGPCode") { |
| | | string action = root["action"].asString(); |
| | | if (action == "setGPCode") { |
| | | //设置股票代码 |
| | | int index = root["data"]["index"].asInt(); |
| | | string code = root["data"]["code"].asString(); |
| | |
| | | //恢复采集 |
| | | app->capture->start(index); |
| | | } |
| | | else if (action == "repairL2Data") { |
| | | |
| | | if (!app->capture->isInited()) { |
| | | throw string("采集器尚未初始化"); |
| | | } |
| | | try { |
| | | //修正L2的数据 |
| | | int index = root["data"]["index"].asInt(); |
| | | string code = root["data"]["code"].asString(); |
| | | double min_price = root["data"]["min_price"].asDouble(); |
| | | double max_price = root["data"]["max_price"].asDouble(); |
| | | list<TradeData> dataList = app->capture->captureLevel2TradeData(CaptureUtil::capture(index, CAPTURE_TYPE_L2), index); |
| | | |
| | | bool success = false; |
| | | int retryCount = 0; |
| | | while (!success) |
| | | { |
| | | if (retryCount > 3) { |
| | | break; |
| | | } |
| | | //点击代码 |
| | | retryCount++; |
| | | THSActionUtil::setListenL2GP(index, code, recognitionManager); |
| | | Sleep(1); |
| | | bool normal = true; |
| | | |
| | | for (list<TradeData>::iterator ele = dataList.begin();ele != dataList.end();++ele) { |
| | | double price = stod((*ele).price); |
| | | if (price >= max_price + 0.0001) { |
| | | normal = false; |
| | | break; |
| | | } |
| | | else if (price <= min_price - 0.0001) { |
| | | normal = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | cout << code << "-repairL2Data是否修复成功:" << normal << endl; |
| | | |
| | | success = normal; |
| | | } |
| | | } |
| | | catch (...) { |
| | | throw string("未知错误"); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | //5s一次心跳 |
| | | while (true) |
| | | { |
| | | MEMORYSTATUS ms; |
| | | ::GlobalMemoryStatus(&ms); |
| | | DWORD mer = ms.dwMemoryLoad; |
| | | cout << "内存使用率:" << mer << endl; |
| | | |
| | | try { |
| | | string msg = JsonUtil::loadHeartbeatData(clientNum); |
| | | string msg = JsonUtil::loadHeartbeatData(clientNum,to_string(mer)); |
| | | SocketManager::sendMsg(msg.c_str()); |
| | | cout << "心跳信号" << endl; |
| | | //cout << "心跳信号" << endl; |
| | | } |
| | | catch (...) { |
| | | cout << "心跳信号异常" << endl; |
| | | } |
| | | Sleep(5000); |
| | | } |
| | | } |
| | | |
| | | void CappDlg::initCapture() |
| | | { |
| | | if (!capture->isInited()) |
| | | { |
| | | try { |
| | | capture->init(OnL2DataCallback, OnTradeQueueDataCallback, this); |
| | | } |
| | | catch (string st) { |
| | | CString msg(st.c_str()); |
| | | AfxMessageBox(msg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | void CappDlg::autoStartL2(void* context) |
| | | { |
| | | Sleep(1500); |
| | | CappDlg* app =(CappDlg*) context; |
| | | //点击检查同花顺 |
| | | app->OnBnClickedButton21(); |
| | | Sleep(1000); |
| | | //启动L2行情识别 |
| | | app->OnBnClickedButton5(); |
| | | //启动交易成功识别 |
| | | app->OnBnClickedButtonTrade(); |
| | | //启动涨停识别 |
| | | //OnBnClickedButton12(); |
| | | } |
| | | |
| | | |
| | |
| | | //识别测试 |
| | | void CappDlg::OnBnClickedButton9() |
| | | { |
| | | if (!capture->isInited()) |
| | | { |
| | | try { |
| | | capture->init(OnL2DataCallback, OnTradeQueueDataCallback, this); |
| | | } |
| | | catch (string st) { |
| | | CString msg(st.c_str()); |
| | | AfxMessageBox(msg); |
| | | } |
| | | } |
| | | initCapture(); |
| | | |
| | | clock_t time = clock(); |
| | | |
| | | CString path = GUITool::selectImage(); |
| | |
| | | |
| | | try { |
| | | map<int, string> result = THSActionUtil::getListenL2GPCodes(recognitionManager); |
| | | if (result.size() == 0) { |
| | | cout << "尚未获取L2的监听代码" << endl; |
| | | } |
| | | //设置代码 |
| | | for (map<int, string>::iterator ele = result.begin();ele != result.end();ele++) { |
| | | int key = (*ele).first; |
| | |
| | | |
| | | SplitType types[] = { NUM_TYPE_MONEY, NUM_TYPE_CODE }; |
| | | |
| | | list<list<GPDataStruct>> resultList = gpDataCapture->captureGPData(grayImg, types, 6); |
| | | list<list<GPDataStruct>> resultList = gpDataCapture->captureGPData(grayImg, types, 6, 1, 2); |
| | | |
| | | for (list<list<GPDataStruct>>::iterator ele1 = resultList.begin();ele1 != resultList.end();ele1++) { |
| | | IndustryData industryData = IndustryData(); |
| | |
| | | |
| | | SplitType types[] = { NUM_TYPE_MONEY, NUM_TYPE_CODE }; |
| | | |
| | | list<list<GPDataStruct>> resultList = gpDataCapture->captureGPData(grayImg, types, 6); |
| | | list<list<GPDataStruct>> resultList = gpDataCapture->captureGPData(grayImg, types, 6, 1, 2); |
| | | |
| | | for (list<list<GPDataStruct>>::iterator ele1 = resultList.begin();ele1 != resultList.end();ele1++) { |
| | | IndustryData industryData = IndustryData(); |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | //测试按钮 |
| | | void CappDlg::OnBnClickedButtonTest() |
| | | { |
| | | int index = 0; |
| | | std::list<TradeData> dataList; |
| | | for (int i = 0;i < 10;i++) { |
| | | TradeData data = TradeData(); |
| | | //7.32 |
| | | data.time = "09:30:00"; |
| | | data.price = "26.84"; |
| | | data.operateType = OPERATE_BUY; |
| | | data.limitPrice = LIMIT_PRICE_UP; |
| | | data.num = 5000 + i; |
| | | dataList.push_back(data); |
| | | } |
| | | |
| | | for (int i = 10;i < 11;i++) { |
| | | TradeData data = TradeData(); |
| | | //7.32 |
| | | data.time = "09:30:00"; |
| | | data.price = "26.84"; |
| | | data.operateType = OPERATE_BUY_CANCEL; |
| | | data.limitPrice = LIMIT_PRICE_UP; |
| | | data.num = 5000 + i; |
| | | dataList.push_back(data); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | string data = JsonUtil::loadL2Data(clientNum, 0, "002338", dataList); |
| | | clock_t time_start = clock(); |
| | | try { |
| | | socketManager->sendMsg(index, data.c_str()); |
| | | } |
| | | catch (string st) { |
| | | //重新连接服务器 |
| | | socketManager->resetClient(index); |
| | | socketManager->Connect(index); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | void CappDlg::OnBnClickedCheck5() |
| | | { |
| | | L2DataCapture::setTradeTimeCapture(tradeTimeCaptureCheck.GetCheck()); |
| | | } |
| | | |
| | | |
| | | |
| | | void CappDlg::OnBnClickedButton21() |
| | | { |
| | | |
| | | try { |
| | | THSActionUtil::checkEnv(); |
| | | } |
| | | catch (string e) { |
| | | //打开同花顺的所有屏幕 |
| | | try { |
| | | HWND l2 = THSActionUtil::getL2Win(); |
| | | if (l2 <= 0) { |
| | | //尝试打开主屏 |
| | | HWND main = THSActionUtil::getMainWin(); |
| | | if (main > 0) |
| | | { |
| | | Win32Util::focus(main); |
| | | Win32Util::keyboardNum(".00", 200); |
| | | Win32Util::keyboard(13, 10); |
| | | Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | THSActionUtil::openSecondScreen(); |
| | | Sleep(1000); |
| | | THSActionUtil::openThirdScreen(); |
| | | Sleep(1000); |
| | | } |
| | | catch (...) { |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | try { |
| | | HWND l2 = THSActionUtil::getL2Win(); |
| | | if (l2 > 0) |
| | | { |
| | | Win32Util::showWindow(l2); |
| | | } |
| | | |
| | | HWND second = THSActionUtil::getSecondWindow(); |
| | | if (second <= 0) { |
| | | AfxMessageBox(_T("同花顺副屏1未打开")); |
| | | return; |
| | | } |
| | | |
| | | Win32Util::showWindow(second); |
| | | |
| | | |
| | | HWND third = THSActionUtil::getThirdWindow(); |
| | | if (third <= 0) { |
| | | AfxMessageBox(_T("同花顺副屏2未打开")); |
| | | return; |
| | | } |
| | | |
| | | Win32Util::showWindow(third); |
| | | |
| | | |
| | | //设置 |
| | | DEVMODE device = Win32Util::getL2ScreenInfo(); |
| | | int device_width = device.dmPelsWidth; |
| | | int device_height = device.dmPelsHeight; |
| | | POINTL device_pos = device.dmPosition; |
| | | //最大化L2 |
| | | Win32Util::moveWin(l2, device_pos.x, device_pos.y, device_width, device_height); |
| | | //将副屏1与副屏2缩小为屏幕的一半 |
| | | Win32Util::moveWin(second, device_pos.x, device_pos.y + device_height / 2, device_width / 2 - 50, device_height / 2); |
| | | Win32Util::moveWin(third, device_pos.x + device_width / 2 + 30, device_pos.y + device_height / 2, device_width / 2 - 50, device_height / 2); |
| | | } |
| | | catch (string e) { |
| | | CString msg(e.c_str()); |
| | | AfxMessageBox(msg); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | void CappDlg::OnBnClickedButton22() |
| | | { |
| | | try { |
| | | //刷新L2窗口句柄 |
| | | capture->refreshHWND(); |
| | | //刷新涨停句柄 |
| | | limitUpCapture->refreshHWND(); |
| | | } |
| | | catch (string e) { |
| | | CString msg(e.c_str()); |
| | | AfxMessageBox(msg); |
| | | } |
| | | catch (...) { |
| | | AfxMessageBox(_T("未知错误")); |
| | | } |
| | | } |
| | | |
| | | |
| | | //退出登录 |
| | | void CappDlg::OnBnClickedLogoutBtn() |
| | | { |
| | | SendMessage(WM_CLOSE); |
| | | loginDlg dlg(this); |
| | | dlg.setReLogin(true); |
| | | dlg.DoModal(); |
| | | } |
| | | |
| | | |
| | | //是否自动开启L2行情 |
| | | void CappDlg::OnBnClickedCheck6() |
| | | { |
| | | std::list<string> settings; |
| | | if (autoL2Check.GetCheck()) { |
| | | settings.push_back("1"); |
| | | } |
| | | else { |
| | | settings.push_back("0"); |
| | | } |
| | | Tool::saveSettings("setting.txt", settings); |
| | | } |
| | |
| | | |
| | | static void onHeartbeat(); |
| | | |
| | | void initCapture(); |
| | | |
| | | static void autoStartL2(void* context); |
| | | |
| | | |
| | | // 构造 |
| | | public: |
| | |
| | | afx_msg void OnBnClickedButton10(); |
| | | afx_msg void OnBnClickedButton9(); |
| | | afx_msg void OnBnClickedButton4(); |
| | | afx_msg void OnBnClickedButton20(); |
| | | afx_msg void OnBnClickedButton5(); |
| | | afx_msg void OnBnClickedButton20(); |
| | | afx_msg void OnBnClickedButton7(); |
| | | afx_msg void OnBnClickedButton8(); |
| | | CButton limitUpUpload; |
| | |
| | | CButton uploadGPBtn; |
| | | CButton delegateBtn; |
| | | afx_msg void OnBnClickedButtonTradeDelegate(); |
| | | afx_msg void OnBnClickedButtonTest(); |
| | | CButton tradeTimeCaptureCheck; |
| | | afx_msg void OnBnClickedCheck5(); |
| | | CButton refreshHWNDBtn; |
| | | CButton resetTHSBtn; |
| | | afx_msg void OnBnClickedButton21(); |
| | | afx_msg void OnBnClickedButton22(); |
| | | afx_msg void OnBnClickedLogoutBtn(); |
| | | CButton autoL2Check; |
| | | afx_msg void OnBnClickedCheck6(); |
| | | }; |
| | |
| | | return v >= 64 ? 1 : 0; |
| | | } |
| | | |
| | | __kernel void split_num(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, int width, int num_width, int num_height, int num_count, |
| | | //分隔板块数字 |
| | | __kernel void split_plate_num(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, __global const unsigned char* types, int width, int num_width, int num_height, int ele_count_per_line, int length_per_num, |
| | | __global unsigned char* result) { |
| | | |
| | | int index = get_global_id(0); |
| | | //区域坐标 |
| | | int startP = index * 4; |
| | | int startx = pos_in[startP]; |
| | | int starty = pos_in[startP + 1]; |
| | | int endx = pos_in[startP + 2]; |
| | | int endy = pos_in[startP + 3]; |
| | | |
| | | if (startx > 0) |
| | | { |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | } |
| | | int cols = endx - startx + 1; |
| | | int rows = endy - starty + 1; |
| | | |
| | | //每个元素占用6个数字的空间,不够的前面填充0 |
| | | int num_count = ele_count_per_line * length_per_num; |
| | | |
| | | int nps[12]; |
| | | //只能识别4种数字 |
| | | unsigned char type = types[index % ele_count_per_line]; |
| | | //printf("ele_count_line:%d\n", ele_count_line); |
| | | //时间 |
| | | if (type == 0) { |
| | | //时间 |
| | | int s = cols / 2; |
| | | int i; |
| | | //往前查找冒号 |
| | | int m1_s = -1, m1_e = -1, m2_s = -1, m2_e = -1; |
| | | uchar temp[10]; |
| | | for (i = s;i > -1;i--) { |
| | | if (i < 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i - 1, endy)]); |
| | | |
| | | |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i - 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i - 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 1)]); |
| | | temp[8] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy - 2)]); |
| | | temp[9] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 2)]); |
| | | if (temp[3] > 0 && temp[2] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | int t = temp[0] + temp[1] + temp[4] + temp[5] + temp[8] + temp[9]; |
| | | if (t == 0) { |
| | | m1_s = i - 5; |
| | | m1_e = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //往后查找冒号 |
| | | |
| | | for (i = s;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]); |
| | | temp[8] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 2)]); |
| | | temp[9] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 2)]); |
| | | if (temp[2] > 0 && temp[3] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | int t = temp[0] + temp[1] + temp[4] + temp[5] + temp[8] + temp[9]; |
| | | if (t == 0) { |
| | | m2_s = i; |
| | | m2_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | //没有分割成功的话填充0 |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | //3个时间的坐标 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m1_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m1_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = startx + m2_s - 1; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = startx + m2_e + 1; |
| | | nps[9] = starty; |
| | | nps[10] = endx; |
| | | nps[11] = endy; |
| | | } |
| | | |
| | | |
| | | } |
| | | //金额 |
| | | else if (type == 1) { |
| | | //查找单位前的空格 |
| | | int num_end = -1; |
| | | int i; |
| | | for (i = endx - 11;i >= startx;i--) { |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, i, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | num_end = i - 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if (num_end >= 0) { |
| | | endx = num_end; |
| | | } |
| | | |
| | | //去除上下的空白 |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | |
| | | |
| | | |
| | | cols = endx - startx + 1; |
| | | |
| | | |
| | | |
| | | |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[8]; |
| | | |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]); |
| | | if (temp[2] > 0 && temp[3] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | |
| | | if (temp[0] + temp[1] + temp[4] + temp[5] == 0) |
| | | { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy - 1;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | //printf("没有找到小数点:%d\n", index); |
| | | } |
| | | else { |
| | | |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = num_end; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //价格 |
| | | else if (type == 2) { |
| | | //股价 |
| | | |
| | | //printf("startx:%d starty:%d endx:%d endy:%d\n",startx,starty,endx,endy); |
| | | |
| | | //往前查找小数点 |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[8]; |
| | | int i; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy - 1)]); |
| | | temp[7] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]); |
| | | if (temp[2] > 0 && temp[3] > 0 && temp[6] > 0 && temp[7] > 0) { |
| | | |
| | | if (temp[0] + temp[1] + temp[4] + temp[5] == 0) |
| | | { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy - 1;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = endx; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | |
| | | } |
| | | //代码与数字 |
| | | else if (type == 3 || type == 4) { |
| | | //手数 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = endx; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | //分隔数据 |
| | | |
| | | //最大分割20个数 |
| | | int numCount = 0; |
| | | //记录分割得到的数据 |
| | | int numberCols[20 * 2]; |
| | | |
| | | int i; |
| | | for (i = 0;i < 3;i++) { |
| | | if (nps[i * 4] == -1) { |
| | | break; |
| | | } |
| | | int _startx = nps[i * 4]; |
| | | int _starty = nps[i * 4 + 1]; |
| | | int _endx = nps[i * 4 + 2]; |
| | | int _endy = nps[i * 4 + 3]; |
| | | int _cols = _endx - _startx + 1; |
| | | |
| | | |
| | | |
| | | int c, startC = -1, endC = -1; |
| | | for (c = 0;c < _cols;c++) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = _starty;y <= _endy;y++) { |
| | | unsigned char value = get_binary_value(img_in[get_one_level_position(width, _startx + c, y)]); |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (empty) { |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | startC = -1; |
| | | endC = -1; |
| | | } |
| | | else { |
| | | if (startC == -1) { |
| | | startC = c; |
| | | endC = c; |
| | | } |
| | | else { |
| | | endC = c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | } |
| | | |
| | | int zeroCount = length_per_num - numCount; |
| | | //最大为20位数 |
| | | int fresult[20 * 2]; |
| | | for (i = 0;i < zeroCount;i++) { |
| | | fresult[i * 2] = -1; |
| | | fresult[i * 2 + 1] = -1; |
| | | } |
| | | |
| | | for (i = 0;i < numCount;i++) { |
| | | fresult[(i + zeroCount) * 2] = numberCols[i * 2]; |
| | | fresult[(i + zeroCount) * 2 + 1] = numberCols[i * 2 + 1]; |
| | | } |
| | | |
| | | //开始填充数据 |
| | | for (i = 0;i < length_per_num;i++) { |
| | | |
| | | unsigned char numData[100 * 100]; |
| | | |
| | | if (fresult[i * 2] == -1) { |
| | | //填充0 |
| | | for (int r = 0;r < num_height;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = get_binary_value(zero[r * num_width + c]); |
| | | //设置输出坐标的值 |
| | | numData[r * num_width + c] = value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else { |
| | | int _startx = fresult[i * 2]; |
| | | int _endx = fresult[i * 2 + 1]; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = 0; |
| | | if (_startx + c <= _endx) { |
| | | //填充空白0 |
| | | value = get_binary_value(img_in[get_one_level_position(width, _startx + c, r)]); |
| | | //设置输出坐标的值 |
| | | numData[(r - starty) * num_width + c] = value; |
| | | } |
| | | else { |
| | | numData[(r - starty) * num_width + c] = 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int rowDataCount = num_height * num_width * 10 * num_count; |
| | | int rowIndex = index / ele_count_per_line; |
| | | int index_0 = rowDataCount * rowIndex; |
| | | //行偏移量 |
| | | int index_2 = (num_width * 10) * (length_per_num * (index % ele_count_per_line) + i); |
| | | |
| | | for (int re = 0;re < 10;re++) { |
| | | int index_3 = re * num_width; |
| | | for (int r = 0;r < num_height;r++) { |
| | | int index_1 = r * (num_width * 10 * num_count); |
| | | for (int c = 0;c < num_width;c++) { |
| | | int findex = index_0 + index_1 + index_2 + index_3 + c; |
| | | //printf("index:%d-findex:%d value:%d \n", index, findex, numData[r * num_width + c]); |
| | | result[findex] = numData[r * num_width + c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //printf("\n"); |
| | | } |
| | | |
| | | |
| | | __kernel void split_l2_num_new(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, __global const unsigned char* types, int width, int num_width, int num_height, int ele_count_per_line, int length_per_num, |
| | | __global unsigned char* result) { |
| | | |
| | | //printf("ele_count_per_line:%d length_per_num:%d\n", ele_count_per_line, length_per_num); |
| | | |
| | | int index = get_global_id(0); |
| | | //区域坐标 |
| | | int startP = index * 4; |
| | | int startx = pos_in[startP]; |
| | | int starty = pos_in[startP + 1]; |
| | | int endx = pos_in[startP + 2]; |
| | | int endy = pos_in[startP + 3]; |
| | | |
| | | if (startx > 0) |
| | | { |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | } |
| | | int cols = endx - startx + 1; |
| | | int rows = endy - starty + 1; |
| | | |
| | | //每个元素占用6个数字的空间,不够的前面填充0 |
| | | int num_count = ele_count_per_line * length_per_num; |
| | | |
| | | int nps[12]; |
| | | //只能识别4种数字 |
| | | unsigned char type = types[index % ele_count_per_line]; |
| | | //printf("ele_count_line:%d\n", ele_count_line); |
| | | //时间 |
| | | if (type == 0) { |
| | | //时间 |
| | | int s = cols / 2; |
| | | int i; |
| | | //往前查找冒号 |
| | | int m1_s = -1, m1_e = -1, m2_s = -1, m2_e = -1; |
| | | uchar temp[7]; |
| | | for (i = s;i > -1;i--) { |
| | | if (i < 6) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i - 1, endy)]); |
| | | |
| | | |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i - 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i - 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i - 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i - 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i - 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m1_s = i - 6; |
| | | m1_e = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //往后查找冒号 |
| | | |
| | | for (i = s;i < cols;i++) { |
| | | if (i > cols - 6) { |
| | | break; |
| | | } |
| | | |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | temp[6] = get_binary_value(img_in[get_one_level_position(width, startx + i + 6, endy)]); |
| | | if (temp[3] > 0 && get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy - 1)]) == 0) { |
| | | int t = temp[0] + temp[1] + temp[2] + temp[4] + temp[5] + temp[6]; |
| | | if (t == 0) { |
| | | m2_s = i; |
| | | m2_e = i + 6; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | //没有分割成功的话填充0 |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | //3个时间的坐标 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m1_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m1_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = startx + m2_s - 1; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = startx + m2_e + 1; |
| | | nps[9] = starty; |
| | | nps[10] = endx; |
| | | nps[11] = endy; |
| | | } |
| | | |
| | | |
| | | } |
| | | //金额 |
| | | else if (type == 1) { |
| | | //查找单位前的空格 |
| | | int num_end = -1; |
| | | int i; |
| | | for (i = endx - 9;i >= startx;i--) { |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, i, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | num_end = i - 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (num_end >= 0) { |
| | | endx = num_end; |
| | | } |
| | | |
| | | //去除上下的空白 |
| | | int startNy = -1; |
| | | int endNy = -1; |
| | | //去除上下的白边 |
| | | int y = 0; |
| | | for (y = starty;y <= endy;y++) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | startNy = y; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | for (y = endy;y >= starty;y--) { |
| | | bool empty = 1; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | int p = get_one_level_position(width, x, y); |
| | | unsigned char value = get_binary_value(img_in[p]); |
| | | //有数据 |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (!empty) { |
| | | endNy = y; |
| | | break; |
| | | } |
| | | } |
| | | starty = startNy; |
| | | endy = endNy; |
| | | |
| | | |
| | | |
| | | cols = endx - startx + 1; |
| | | |
| | | |
| | | |
| | | //查找小数点 |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[6]; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | if (temp[2] > 0) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | unsigned char t = temp[0] + temp[1] + temp[3] + temp[4] + temp[5]; |
| | | if (t == 0) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = num_end; |
| | | nps[7] = endy; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //价格 |
| | | else if (type == 2) { |
| | | //股价 |
| | | |
| | | //printf("startx:%d starty:%d endx:%d endy:%d\n",startx,starty,endx,endy); |
| | | |
| | | int m_s = -1, m_e = -1; |
| | | uchar temp[6]; |
| | | int i; |
| | | for (i = 0;i < cols;i++) { |
| | | if (i > cols - 5) { |
| | | break; |
| | | } |
| | | temp[0] = get_binary_value(img_in[get_one_level_position(width, startx + i, endy)]); |
| | | |
| | | temp[1] = get_binary_value(img_in[get_one_level_position(width, startx + i + 1, endy)]); |
| | | temp[2] = get_binary_value(img_in[get_one_level_position(width, startx + i + 2, endy)]); |
| | | temp[3] = get_binary_value(img_in[get_one_level_position(width, startx + i + 3, endy)]); |
| | | temp[4] = get_binary_value(img_in[get_one_level_position(width, startx + i + 4, endy)]); |
| | | temp[5] = get_binary_value(img_in[get_one_level_position(width, startx + i + 5, endy)]); |
| | | if (temp[2] > 0) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(img_in[get_one_level_position(width, startx + i + 2, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | //小数点上方为空值 |
| | | if (empty) { |
| | | unsigned char t = temp[0] + temp[1] + temp[3] + temp[4] + temp[5]; |
| | | if (t == 0) { |
| | | m_s = i; |
| | | m_e = i + 5; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_s == -1 || m_e == -1) { |
| | | nps[0] = -1; |
| | | nps[1] = -1; |
| | | nps[2] = -1; |
| | | nps[3] = -1; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | else { |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = startx + m_s - 1; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = startx + m_e + 1; |
| | | nps[5] = starty; |
| | | nps[6] = endx; |
| | | nps[7] = endy; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | |
| | | } |
| | | //代码与数字 |
| | | else if (type == 3 || type == 4) { |
| | | //手数 |
| | | nps[0] = startx; |
| | | nps[1] = starty; |
| | | nps[2] = endx; |
| | | nps[3] = endy; |
| | | |
| | | nps[4] = -1; |
| | | nps[5] = -1; |
| | | nps[6] = -1; |
| | | nps[7] = -1; |
| | | |
| | | nps[8] = -1; |
| | | nps[9] = -1; |
| | | nps[10] = -1; |
| | | nps[11] = -1; |
| | | } |
| | | //分隔数据 |
| | | |
| | | //最大分割20个数 |
| | | int numCount = 0; |
| | | //记录分割得到的数据 |
| | | int numberCols[20 * 2]; |
| | | |
| | | int i; |
| | | for (i = 0;i < 3;i++) { |
| | | if (nps[i * 4] == -1) { |
| | | break; |
| | | } |
| | | int _startx = nps[i * 4]; |
| | | int _starty = nps[i * 4 + 1]; |
| | | int _endx = nps[i * 4 + 2]; |
| | | int _endy = nps[i * 4 + 3]; |
| | | int _cols = _endx - _startx + 1; |
| | | |
| | | |
| | | |
| | | int c, startC = -1, endC = -1; |
| | | for (c = 0;c < _cols;c++) { |
| | | |
| | | bool empty = 1; |
| | | for (int y = _starty;y <= _endy;y++) { |
| | | unsigned char value = get_binary_value(img_in[get_one_level_position(width, _startx + c, y)]); |
| | | if (value > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (empty) { |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | startC = -1; |
| | | endC = -1; |
| | | } |
| | | else { |
| | | if (startC == -1) { |
| | | startC = c; |
| | | endC = c; |
| | | } |
| | | else { |
| | | endC = c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (startC > -1 && endC > -1) { |
| | | numberCols[numCount * 2] = _startx + startC; |
| | | numberCols[numCount * 2 + 1] = _startx + endC; |
| | | numCount++; |
| | | } |
| | | } |
| | | |
| | | int zeroCount = length_per_num - numCount; |
| | | //最大为20位数 |
| | | int fresult[20 * 2]; |
| | | for (i = 0;i < zeroCount;i++) { |
| | | fresult[i * 2] = -1; |
| | | fresult[i * 2 + 1] = -1; |
| | | } |
| | | |
| | | for (i = 0;i < numCount;i++) { |
| | | fresult[(i + zeroCount) * 2] = numberCols[i * 2]; |
| | | fresult[(i + zeroCount) * 2 + 1] = numberCols[i * 2 + 1]; |
| | | } |
| | | |
| | | //开始填充数据 |
| | | for (i = 0;i < length_per_num;i++) { |
| | | |
| | | unsigned char numData[100 * 100]; |
| | | |
| | | if (fresult[i * 2] == -1) { |
| | | //填充0 |
| | | for (int r = 0;r < num_height;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = get_binary_value(zero[r * num_width + c]); |
| | | //设置输出坐标的值 |
| | | numData[r * num_width + c] = value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else { |
| | | int _startx = fresult[i * 2]; |
| | | int _endx = fresult[i * 2 + 1]; |
| | | for (int r = starty;r <= endy;r++) { |
| | | for (int c = 0;c < num_width;c++) { |
| | | unsigned char value = 0; |
| | | if (_startx + c <= _endx) { |
| | | //填充空白0 |
| | | value = get_binary_value(img_in[get_one_level_position(width, _startx + c, r)]); |
| | | //设置输出坐标的值 |
| | | numData[(r - starty) * num_width + c] = value; |
| | | } |
| | | else { |
| | | numData[(r - starty) * num_width + c] = 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int rowDataCount = num_height * num_width * 10 * num_count; |
| | | int rowIndex = index / ele_count_per_line; |
| | | int index_0 = rowDataCount * rowIndex; |
| | | //行偏移量 |
| | | int index_2 = (num_width * 10) * (length_per_num * (index % ele_count_per_line) + i); |
| | | |
| | | for (int re = 0;re < 10;re++) { |
| | | int index_3 = re * num_width; |
| | | for (int r = 0;r < num_height;r++) { |
| | | int index_1 = r * (num_width * 10 * num_count); |
| | | for (int c = 0;c < num_width;c++) { |
| | | int findex = index_0 + index_1 + index_2 + index_3 + c; |
| | | //printf("index:%d-findex:%d value:%d \n", index, findex, numData[r * num_width + c]); |
| | | result[findex] = numData[r * num_width + c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //printf("\n"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //分割L2数字 |
| | | __kernel void split_l2_num(__global const unsigned char* img_in, __global const int* pos_in, __global const unsigned char* zero, int width, int num_width, int num_height, int num_count, |
| | | __global unsigned char* result) { |
| | | |
| | | int index = get_global_id(0); |
| | |
| | | } |
| | | } |
| | | if (m1_s < 0 || m1_e < 0 || m2_s < 0 || m2_e < 0) { |
| | | printf("未查找到冒号:m1_s:%d m1_end:%d m2_s:%d m2_e:%d\n", m1_s, m1_e, m2_s, m2_e); |
| | | //printf("未查找到冒号:m1_s:%d m1_end:%d m2_s:%d m2_e:%d\n", m1_s, m1_e, m2_s, m2_e); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | __kernel void splitRowData(__global unsigned char* imgs, __global int* rowIndexs, int width, |
| | | __kernel void splitL2RowData(__global unsigned char* imgs, __global int* rowIndexs, int width, |
| | | __global int* result) { |
| | | int gid = get_global_id(0); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | __kernel void splitCommonRowData(__global unsigned char* imgs, __global int* rowIndexs, int width, int fromIndex, int toIndex, |
| | | __global int* result) { |
| | | int gid = get_global_id(0); |
| | | |
| | | int startCol = rowIndexs[gid * 4]; |
| | | int startRow = rowIndexs[gid * 4 + 1]; |
| | | int endCol = rowIndexs[gid * 4 + 2]; |
| | | int endRow = rowIndexs[gid * 4 + 3]; |
| | | |
| | | //printf(" index:%d - startCol:%d,startRow:%d,endCol:%d,endRow:%d\n", gid, startCol, startRow, endCol, endRow); |
| | | |
| | | |
| | | int emptyStart = -1; |
| | | int emptyEnd = -1; |
| | | int dataStart = -1; |
| | | int dataEnd = -1; |
| | | |
| | | int rowDataSize = 0; |
| | | int ELE_NUMBER_PER_LINE = toIndex - fromIndex + 1; |
| | | //每行最多50个数据 |
| | | int rowDataIndexs[50 * 4]; |
| | | |
| | | //排除第一列序号列 |
| | | int startRowDataIndex = (ELE_NUMBER_PER_LINE) * 4 * gid; |
| | | |
| | | for (int i = startCol;i <= endCol;i++) { |
| | | |
| | | bool empty = 1; |
| | | for (int j = startRow;j <= endRow;j++) { |
| | | unsigned char value = imgs[get_one_level_position(width, i, j)]; |
| | | if (value >= 64) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | if (emptyStart < 0) { |
| | | emptyStart = i; |
| | | emptyEnd = i; |
| | | } |
| | | else { |
| | | emptyEnd = i; |
| | | } |
| | | |
| | | //5个及以上的空白数据才分列 |
| | | if (emptyEnd - emptyStart >= 5 && dataEnd - dataStart > 0) { |
| | | if (rowDataSize >= fromIndex && rowDataSize <= toIndex) |
| | | { |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 0] = dataStart; |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 1] = startRow; |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 2] = dataEnd; |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 3] = endRow; |
| | | } |
| | | rowDataSize++; |
| | | |
| | | |
| | | dataEnd = -1; |
| | | dataStart = -1; |
| | | } |
| | | } |
| | | else { |
| | | if (dataStart < 0) { |
| | | dataStart = i; |
| | | dataEnd = i; |
| | | } |
| | | else { |
| | | dataEnd = i; |
| | | } |
| | | |
| | | emptyStart = -1; |
| | | emptyEnd = -1; |
| | | } |
| | | } |
| | | //后面的数据没有足够的空白分隔 |
| | | if (dataEnd - dataStart > 0) { |
| | | if (rowDataSize >= fromIndex && rowDataSize <= toIndex) |
| | | { |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 0] = dataStart; |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 1] = startRow; |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 2] = dataEnd; |
| | | rowDataIndexs[(rowDataSize - fromIndex) * 4 + 3] = endRow; |
| | | } |
| | | rowDataSize++; |
| | | } |
| | | |
| | | int emptyCount = 0; |
| | | for (int i = 0;i < ELE_NUMBER_PER_LINE;i++) { |
| | | result[startRowDataIndex + 4 * i + 0] = rowDataIndexs[4 * (i - emptyCount) + 0]; |
| | | result[startRowDataIndex + 4 * i + 1] = rowDataIndexs[4 * (i - emptyCount) + 1]; |
| | | result[startRowDataIndex + 4 * i + 2] = rowDataIndexs[4 * (i - emptyCount) + 2]; |
| | | result[startRowDataIndex + 4 * i + 3] = rowDataIndexs[4 * (i - emptyCount) + 3]; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //RGB图转为灰度图 |
| | | __kernel void rgb2GrayImg(__global unsigned char* imgs, int width, |
| | | __global unsigned char* result) { |
| | |
| | | unsigned char G = imgs[start + 1]; |
| | | unsigned char B = imgs[start + 2]; |
| | | result[index] = (76 * R + 150 * G + 30 * B) >> 8; |
| | | } |
| | | } |
| | | |
| | | __kernel void rgb2ThresholdInvert(__global unsigned char* imgs, int width, |
| | | __global unsigned char* result) { |
| | | |
| | | int rowIndex = get_global_id(0); |
| | | |
| | | for (int c = 0;c < width;c++) { |
| | | int index = rowIndex * width + c; |
| | | int start = index * 3; |
| | | unsigned char R = imgs[start]; |
| | | unsigned char G = imgs[start + 1]; |
| | | unsigned char B = imgs[start + 2]; |
| | | int v = (76 * R + 150 * G + 30 * B) >> 8; |
| | | |
| | | if (v > 64) { |
| | | result[index] = 0; |
| | | } |
| | | else { |
| | | result[index] = 255; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | __kernel void rgba2ThresholdInvert(__global unsigned char* imgs, int width, |
| | | __global unsigned char* result) { |
| | | |
| | | int rowIndex = get_global_id(0); |
| | | |
| | | for (int c = 0;c < width;c++) { |
| | | int index = rowIndex * width + c; |
| | | int start = index * 4; |
| | | unsigned char R = imgs[start]; |
| | | unsigned char G = imgs[start + 1]; |
| | | unsigned char B = imgs[start + 2]; |
| | | int v = (76 * R + 150 * G + 30 * B) >> 8; |
| | | if (v > 64) { |
| | | result[index] = 0; |
| | | } |
| | | else { |
| | | result[index] = 255; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //L2非数字识别 |
| | | __kernel void recognition_not_num(__global unsigned char* imgs, __global int* rowIndexs, int width, |
| | | __global int* result) { |
| | |
| | | int endy = startx + 3; |
| | | if (rowIndexs[startx] > 0) { |
| | | int emptyX = -1; |
| | | for (int x = endx;x >= startx;x--) |
| | | for (int x = rowIndexs[endx];x >= rowIndexs[startx];x--) |
| | | { |
| | | bool empty = true; |
| | | for (int y = starty;y <= endy;y++) { |
| | | for (int y = rowIndexs[starty];y <= rowIndexs[endy];y++) { |
| | | unsigned char value = imgs[get_one_level_position(width, x, y)]; |
| | | if (get_binary_value(value)) { |
| | | empty = 0; |
| | |
| | | } |
| | | } |
| | | if (emptyX > 0) { |
| | | startx = emptyX + 1; |
| | | } |
| | | //计算值 |
| | | unsigned char count = 0; |
| | | for (int x = startx;x <= endx;x++) |
| | | { |
| | | for (int y = starty;y <= endy;y++) { |
| | | unsigned char value = imgs[get_one_level_position(width, x, y)]; |
| | | count += get_binary_value(value) ? 1 : 0; |
| | | //计算值 |
| | | unsigned char count = 0; |
| | | for (int x = emptyX + 1;x <= rowIndexs[endx];x++) |
| | | { |
| | | for (int y = rowIndexs[starty];y <= rowIndexs[endy];y++) { |
| | | unsigned char value = imgs[get_one_level_position(width, x, y)]; |
| | | count += get_binary_value(value) ? 1 : 0; |
| | | } |
| | | } |
| | | //printf("row:%d count:%d\n", row, count); |
| | | if (abs(count - 12) <= 1) {//S |
| | | result[row * 3] = 0; |
| | | } |
| | | else if (abs(count - 16) <= 1) {//M |
| | | result[row * 3] = 1; |
| | | } |
| | | else if (abs(count - 19) <= 1) {//H |
| | | result[row * 3] = 2; |
| | | } |
| | | |
| | | } |
| | | printf("count:%d",count); |
| | | result[row * 3] = 0; |
| | | } |
| | | else { |
| | | //默认s |
| | | result[row * 3] = 0; |
| | | //printf("row:%d count:0\n", row); |
| | | } |
| | | } |
| | | else if (index % 3 == 1) { |
| | |
| | | int endx = startx + 2; |
| | | int endy = startx + 3; |
| | | if (rowIndexs[startx] <= 0 && rowIndexs[starty] <= 0 && rowIndexs[endx] <= 0 && rowIndexs[endy] <= 0) { |
| | | result[row * 3+1] = 0; |
| | | result[row * 3 + 1] = 0; |
| | | } |
| | | else { |
| | | startx = rowIndexs[startx]; |
| | |
| | | |
| | | if (topValue > bottomValue) { |
| | | //涨停 |
| | | result[row * 3+1] = 1; |
| | | result[row * 3 + 1] = 1; |
| | | } |
| | | else { |
| | | //跌停 |
| | | result[row * 3+1] = 2; |
| | | result[row * 3 + 1] = 2; |
| | | } |
| | | } |
| | | } |
| | |
| | | result[row * 3 + 2] = value; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //识别板块中的金额单位 |
| | | __kernel void recognition_plate_money_unit(__global unsigned char* imgs, __global int* rowIndexs, int width, |
| | | __global int* result) { |
| | | int index = get_global_id(0); |
| | | int start = index * 4; |
| | | int startx = rowIndexs[start + 0]; |
| | | int starty = rowIndexs[start + 1]; |
| | | int endx = rowIndexs[start + 2]; |
| | | int endy = rowIndexs[start + 3]; |
| | | |
| | | int unit_start = -1; |
| | | int i; |
| | | for (i = endx - 11;i >= startx;i--) { |
| | | bool empty = 1; |
| | | for (int y = starty;y < endy;y++) { |
| | | if (get_binary_value(imgs[get_one_level_position(width, i, y)]) > 0) { |
| | | empty = 0; |
| | | break; |
| | | } |
| | | } |
| | | if (empty) { |
| | | unit_start = i + 1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //printf("index:%d unit_start:%d\n", index, unit_start); |
| | | |
| | | int count = 0; |
| | | if (unit_start > -1) |
| | | { |
| | | for (int c = unit_start;c <= endx;c++) { |
| | | for (int y = starty;y <= endy;y++) { |
| | | count += (get_binary_value(imgs[get_one_level_position(width, c, y)]) > 0 ? 1 : 0); |
| | | } |
| | | } |
| | | } |
| | | if (count >= 48) { |
| | | result[index] = 0; |
| | | } |
| | | else { |
| | | result[index] = 1; |
| | | } |
| | | } |
| | |
| | | #include "loginDlg.h" |
| | | #include "appDlg.h" |
| | | #include "afxdialogex.h" |
| | | #include <fstream> |
| | | #ifndef _TOOL_H |
| | | #define _TOOL_H 1 |
| | | #include "tool.h" |
| | |
| | | |
| | | IMPLEMENT_DYNAMIC(loginDlg, CDialogEx) |
| | | |
| | | loginDlg::loginDlg(CWnd* pParent /*=nullptr*/) |
| | | loginDlg::loginDlg(CWnd* pParent) |
| | | : CDialogEx(IDD_LOGIN, pParent) |
| | | { |
| | | } |
| | | |
| | | void loginDlg::setReLogin(bool relogin) |
| | | { |
| | | this->reLogin = relogin; |
| | | } |
| | | |
| | | |
| | | loginDlg::~loginDlg() |
| | | { |
| | | } |
| | | |
| | | void saveUserInfo(string account, string pwd,bool autoLogin) { |
| | | ofstream ofs; |
| | | ofs.open("user.txt", ios::trunc); |
| | | ofs << account << "\n" << pwd<<"\n"<< autoLogin; |
| | | ofs.close(); |
| | | } |
| | | |
| | | list<string> readUserInfo() { |
| | | list<string> mList; |
| | | try { |
| | | ifstream ifs; |
| | | ifs.open("user.txt", ios::in); |
| | | char buf[1024] = { 0 }; |
| | | while (ifs.getline(buf, sizeof(buf))) { |
| | | cout << buf << endl; |
| | | mList.push_back(string(buf)); |
| | | } |
| | | } |
| | | catch (...) { |
| | | } |
| | | return mList; |
| | | } |
| | | |
| | | void loginDlg::DoDataExchange(CDataExchange* pDX) |
| | |
| | | DDX_Control(pDX, IDC_EDIT_HOST, editHost); |
| | | DDX_Control(pDX, IDC_EDIT_ACCOUNT, editAccount); |
| | | DDX_Control(pDX, IDC_EDIT_PWD, editPwd); |
| | | DDX_Control(pDX, IDC_CHECK_AUTO_LOGIN, autoLoginCheck); |
| | | |
| | | editHost.SetWindowTextW(TEXT("192.168.3.252")); |
| | | list<string> resultList = readUserInfo(); |
| | | if (resultList.size() >= 2) { |
| | | list<string>::iterator ele = resultList.begin(); |
| | | CString account((*ele).c_str()); |
| | | editAccount.SetWindowTextW(account); |
| | | ++ele; |
| | | CString pwd((*ele).c_str()); |
| | | editPwd.SetWindowTextW(pwd); |
| | | |
| | | if (resultList.size() >= 3) { |
| | | ++ele; |
| | | string autoLogin = (*ele); |
| | | if (autoLogin == "1") { |
| | | autoLoginCheck.SetCheck(TRUE); |
| | | } |
| | | else { |
| | | autoLoginCheck.SetCheck(FALSE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!reLogin && autoLoginCheck.GetCheck()) { |
| | | startLogin(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | | |
| | | |
| | | // loginDlg 消息处理程序 |
| | | void loginDlg::OnBnClickedButtonLogin() |
| | | { |
| | | startLogin(); |
| | | } |
| | | |
| | | |
| | | void loginDlg::startLogin() |
| | | { |
| | | CString host; |
| | | editHost.GetWindowText(host); |
| | | CString account; |
| | |
| | | string host_str = Tool::cstring2String(host); |
| | | string account_str = Tool::cstring2String(account); |
| | | string pwd_str = Tool::cstring2String(pwd); |
| | | |
| | | |
| | | |
| | | SocketManager::ADDR = host_str; |
| | | |
| | |
| | | std::string msg_str = fastWriter.write(resultJson["msg"]); |
| | | cout << msg_str << endl; |
| | | CString msg; |
| | | Tool::UnicodeToChinese(msg_str,msg); |
| | | Tool::UnicodeToChinese(msg_str, msg); |
| | | AfxMessageBox(msg); |
| | | return; |
| | | } |
| | | saveUserInfo(account_str, pwd_str, autoLoginCheck.GetCheck()); |
| | | //客户端编号 |
| | | CappDlg::clientNum=resultJson["data"]["client"].asInt(); |
| | | CappDlg::clientNum = resultJson["data"]["client"].asInt(); |
| | | |
| | | //解析权限参数 |
| | | Json::Value authoritys= resultJson["data"]["authoritys"]; |
| | | Json::Value authoritys = resultJson["data"]["authoritys"]; |
| | | authoritys.size(); |
| | | set<Authority> alist; |
| | | for (int i = 0;i < authoritys.size();i++) { |
| | | string authority = authoritys[i].asString(); |
| | | string authority = authoritys[i].asString(); |
| | | if (authority._Equal("l2")) { |
| | | alist.insert(AUTHORITY_L2); |
| | | } |
| | |
| | | alist.insert(AUTHORITY_UPLOAD_CODE); |
| | | } |
| | | } |
| | | //赋值权限 |
| | | //赋值权限 |
| | | CappDlg::authoritySet = alist; |
| | | CappDlg dlg(this); |
| | | dlg.DoModal(); |
| | |
| | | AfxMessageBox(_T("未知错误")); |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | private: |
| | | SocketManager* socketManager; |
| | | bool reLogin; |
| | | void startLogin(); |
| | | |
| | | public: |
| | | loginDlg(CWnd* pParent = nullptr); // 标准构造函数 |
| | | |
| | | void setReLogin(bool relogin); |
| | | |
| | | virtual ~loginDlg(); |
| | | |
| | | // 对话框数据 |
| | |
| | | CEdit editAccount; |
| | | CEdit editPwd; |
| | | afx_msg void OnBnClickedButtonLogin(); |
| | | CButton autoLoginCheck; |
| | | }; |
| | |
| | | #define IDC_BUTTON_LOGIN 1028 |
| | | #define IDC_CHECK4 1029 |
| | | #define IDC_BUTTON_TRADE_DELEGATE 1030 |
| | | #define IDC_BUTTON_TEST 1031 |
| | | #define IDC_CHECK5 1032 |
| | | #define IDC_BUTTON21 1033 |
| | | #define IDC_BUTTON22 1034 |
| | | #define IDC_LOGOUT_BTN 1035 |
| | | #define IDC_CHECK_AUTO_LOGIN 1036 |
| | | #define IDC_CHECK6 1037 |
| | | |
| | | // Next default values for new objects |
| | | // |
| | |
| | | #ifndef APSTUDIO_READONLY_SYMBOLS |
| | | #define _APS_NEXT_RESOURCE_VALUE 136 |
| | | #define _APS_NEXT_COMMAND_VALUE 32771 |
| | | #define _APS_NEXT_CONTROL_VALUE 1031 |
| | | #define _APS_NEXT_CONTROL_VALUE 1038 |
| | | #define _APS_NEXT_SYMED_VALUE 101 |
| | | #endif |
| | | #endif |
| | |
| | | #include <tchar.h> |
| | | #include <string> |
| | | #include <stringapiset.h> |
| | | #include <fstream> |
| | | |
| | | class Tool { |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | static void saveSettings(string path,list<string> contentList) { |
| | | ofstream ofs; |
| | | ofs.open(path, ios::trunc); |
| | | |
| | | int index = 0; |
| | | for (list<string>::iterator ele = contentList.begin();ele != contentList.end();++ele) |
| | | { |
| | | index++; |
| | | ofs << *ele; |
| | | if(index<contentList.size()) |
| | | ofs << "\n"; |
| | | } |
| | | ofs.close(); |
| | | } |
| | | |
| | | static list<string> getSettings(string path) { |
| | | list<string> mList; |
| | | try { |
| | | ifstream ifs; |
| | | ifs.open(path, ios::in); |
| | | char buf[1024] = { 0 }; |
| | | while (ifs.getline(buf, sizeof(buf))) { |
| | | cout << buf << endl; |
| | | string content = string(buf); |
| | | if(content.length()>0) |
| | | mList.push_back(string(buf)); |
| | | } |
| | | } |
| | | catch (...) { |
| | | } |
| | | return mList; |
| | | } |
| | | |
| | | }; |
New file |
| | |
| | | client2 |
| | | 123456 |
| | | 0 |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| | | <ItemDefinitionGroup> |
| | | <ClCompile> |
| | | <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| | | <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)\..\lib\native\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| | | </ClCompile> |
| | | </ItemDefinitionGroup> |
| | | <ItemDefinitionGroup Condition="Exists('$(MSBuildThisFileDirectory)..\lib\native\v143\$(Platform)\$(Configuration)\log4cpp.lib')"> |
| | | <Link> |
| | | <AdditionalDependencies>$(MSBuildThisFileDirectory)..\lib\native\v143\$(Platform)\$(Configuration)\log4cpp.lib;%(AdditionalDependencies)</AdditionalDependencies> |
| | | </Link> |
| | | </ItemDefinitionGroup> |
| | | <!-- <ItemDefinitionGroup Condition="Exists('$(MSBuildThisFileDirectory)..\lib\native\v143\$(Platform)\$(Configuration)\log4cpp.dll')"> --> |
| | | <!-- <Link> --> |
| | | <!-- <AdditionalDependencies>$(MSBuildThisFileDirectory)..\lib\native\v143\$(Platform)\$(Configuration)\log4cpp.dll;%(AdditionalDependencies)</AdditionalDependencies> --> |
| | | <!-- </Link> --> |
| | | <!-- </ItemDefinitionGroup> --> |
| | | <ItemDefinitionGroup Condition="Exists('$(MSBuildThisFileDirectory)..\lib\native\v143\$(Platform)\$(Configuration)\log4cpp.pdb')"> |
| | | <Link> |
| | | <ProgramDatabaseFile>$(MSBuildThisFileDirectory)..\lib\native\v143\$(Platform)\$(Configuration)\log4cpp.pdb</ProgramDatabaseFile> |
| | | </Link> |
| | | </ItemDefinitionGroup> |
| | | </Project> |
New file |
| | |
| | | /* |
| | | * AbortAppender.hh |
| | | * |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_ABORTAPPENDER_HH |
| | | #define _LOG4CPP_ABORTAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/AppenderSkeleton.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * This Appender causes the application to abort() upon the first append() |
| | | * call. |
| | | * |
| | | * @since 0.3.5 |
| | | **/ |
| | | class LOG4CPP_EXPORT AbortAppender : public AppenderSkeleton { |
| | | public: |
| | | |
| | | AbortAppender(const std::string& name); |
| | | virtual ~AbortAppender(); |
| | | |
| | | virtual bool reopen(); |
| | | virtual void close(); |
| | | |
| | | /** |
| | | * The AbortAppender does not layout. |
| | | * @returns false |
| | | **/ |
| | | virtual bool requiresLayout() const; |
| | | |
| | | virtual void setLayout(Layout* layout); |
| | | |
| | | protected: |
| | | virtual void _append(const LoggingEvent& event); |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_ABORTAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * Appender.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_APPENDER_HH |
| | | #define _LOG4CPP_APPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <map> |
| | | #include <set> |
| | | #include <vector> |
| | | #include <stdarg.h> |
| | | #include <sys/types.h> |
| | | #include <sys/stat.h> |
| | | #include <fcntl.h> |
| | | #include <log4cpp/Priority.hh> |
| | | #include <log4cpp/Layout.hh> |
| | | #include <log4cpp/LoggingEvent.hh> |
| | | #include <log4cpp/threading/Threading.hh> |
| | | |
| | | namespace log4cpp { |
| | | class LOG4CPP_EXPORT Filter; |
| | | |
| | | /** |
| | | * Implement this interface for your own strategies for printing log |
| | | * statements. |
| | | **/ |
| | | class LOG4CPP_EXPORT Appender { |
| | | friend class Category; |
| | | public: |
| | | |
| | | /** |
| | | * Get a pointer to an exitsing Appender. |
| | | * @param name The name of the Appender to return. |
| | | * @returns a pointer to an existing Appender, or NULL if no appender |
| | | * with the specfied name exists. |
| | | **/ |
| | | static Appender* getAppender(const std::string& name); |
| | | |
| | | /** |
| | | * Call reopen() on all existing Appenders. |
| | | * @returns true if all Appenders returned true on their reopen() call. |
| | | **/ |
| | | static bool reopenAll(); |
| | | |
| | | /** |
| | | * Call reopen() on all existing Appenders. |
| | | * @returns true if all Appenders returned true on their reopen() call. |
| | | **/ |
| | | static void closeAll(); |
| | | |
| | | protected: |
| | | /** |
| | | * Constructor for Appender. Will only be used in getAppender() (and |
| | | * in derived classes of course). |
| | | * @param name The name of this Appender. |
| | | **/ |
| | | Appender(const std::string& name); |
| | | |
| | | public: |
| | | /** |
| | | * Destructor for Appender. |
| | | **/ |
| | | virtual ~Appender(); |
| | | |
| | | /** |
| | | * Log in Appender specific way. |
| | | * @param event The LoggingEvent to log. |
| | | **/ |
| | | virtual void doAppend(const LoggingEvent& event) = 0; |
| | | |
| | | /** |
| | | * Reopens the output destination of this Appender, e.g. the logfile |
| | | * or TCP socket. |
| | | * @returns false if an error occured during reopening, true otherwise. |
| | | **/ |
| | | virtual bool reopen() = 0; |
| | | |
| | | /** |
| | | * Release any resources allocated within the appender such as file |
| | | * handles, network connections, etc. |
| | | **/ |
| | | virtual void close() = 0; |
| | | |
| | | /** |
| | | * Check if the appender uses a layout. |
| | | * |
| | | * @returns true if the appender implementation requires a layout. |
| | | **/ |
| | | virtual bool requiresLayout() const = 0; |
| | | |
| | | /** |
| | | * Set the Layout for this appender. |
| | | * @param layout The layout to use. |
| | | **/ |
| | | virtual void setLayout(Layout* layout) = 0; |
| | | |
| | | /** |
| | | * Get the name of this appender. The name identifies the appender. |
| | | * @returns the name of the appender. |
| | | **/ |
| | | inline const std::string& getName() const { return _name; }; |
| | | |
| | | /** |
| | | * Set the threshold priority of this Appender. The Appender will not |
| | | * appender LoggingEvents with a priority lower than the threshold. |
| | | * Use Priority::NOTSET to disable threshold checking. |
| | | * @param priority The priority to set. |
| | | **/ |
| | | virtual void setThreshold(Priority::Value priority) = 0; |
| | | |
| | | /** |
| | | * Get the threshold priority of this Appender. |
| | | * @returns the threshold |
| | | **/ |
| | | virtual Priority::Value getThreshold() = 0; |
| | | |
| | | /** |
| | | * Set a Filter for this appender. |
| | | **/ |
| | | virtual void setFilter(Filter* filter) = 0; |
| | | |
| | | /** |
| | | * Get the Filter for this appender. |
| | | * @returns the filter, or NULL if no filter has been set. |
| | | **/ |
| | | virtual Filter* getFilter() = 0; |
| | | |
| | | private: |
| | | typedef std::map<std::string, Appender*> AppenderMap; |
| | | |
| | | static AppenderMap& _getAllAppenders(); |
| | | static void _deleteAllAppenders(); |
| | | static void _deleteAllAppendersWOLock(std::vector<Appender*> &appenders); |
| | | static void _addAppender(Appender* appender); |
| | | static void _removeAppender(Appender* appender); |
| | | |
| | | const std::string _name; |
| | | |
| | | public: |
| | | class AppenderMapStorage { |
| | | public: |
| | | Appender::AppenderMap* _allAppenders; // single shared instance, nifty-counter defensed |
| | | threading::Mutex _appenderMapMutex; // mutex protecting map from multiple thread access |
| | | |
| | | AppenderMapStorage(); |
| | | ~AppenderMapStorage(); |
| | | }; |
| | | class LOG4CPP_EXPORT AppenderMapStorageInitializer { |
| | | public: |
| | | AppenderMapStorageInitializer(); |
| | | ~AppenderMapStorageInitializer(); |
| | | }; |
| | | private: |
| | | static AppenderMapStorage &_appenderMapStorageInstance; |
| | | }; |
| | | |
| | | static Appender::AppenderMapStorageInitializer appenderMapStorageInitializer; // static initializer for every translation unit |
| | | typedef std::set<Appender *> AppenderSet; |
| | | |
| | | } |
| | | |
| | | #endif // _LOG4CPP_APPENDER_HH |
New file |
| | |
| | | /* |
| | | * AppenderSkeleton.hh |
| | | * |
| | | * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2001, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_APPENDERSKELETON_HH |
| | | #define _LOG4CPP_APPENDERSKELETON_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Appender.hh> |
| | | #include <log4cpp/Filter.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * AppenderSkeleton is a helper class, simplifying implementation of |
| | | * Appenders: it already takes care of handling of Thresholds and |
| | | * Filters. |
| | | **/ |
| | | class LOG4CPP_EXPORT AppenderSkeleton : public Appender { |
| | | protected: |
| | | /** |
| | | * Constructor for AppenderSkeleton. Will only be used in |
| | | * getAppender() (and in derived classes of course). |
| | | * @param name The name of this Appender. |
| | | **/ |
| | | AppenderSkeleton(const std::string& name); |
| | | |
| | | public: |
| | | /** |
| | | * Destructor for AppenderSkeleton. |
| | | **/ |
| | | virtual ~AppenderSkeleton(); |
| | | |
| | | /** |
| | | * Log in Appender specific way. |
| | | * @param event The LoggingEvent to log. |
| | | **/ |
| | | virtual void doAppend(const LoggingEvent& event); |
| | | |
| | | /** |
| | | * Reopens the output destination of this Appender, e.g. the logfile |
| | | * or TCP socket. |
| | | * @returns false if an error occured during reopening, true otherwise. |
| | | **/ |
| | | virtual bool reopen(); |
| | | |
| | | /** |
| | | * Release any resources allocated within the appender such as file |
| | | * handles, network connections, etc. |
| | | **/ |
| | | virtual void close() = 0; |
| | | |
| | | /** |
| | | * Check if the appender uses a layout. |
| | | * |
| | | * @returns true if the appender implementation requires a layout. |
| | | **/ |
| | | virtual bool requiresLayout() const = 0; |
| | | |
| | | /** |
| | | * Set the Layout for this appender. |
| | | * @param layout The layout to use. |
| | | **/ |
| | | virtual void setLayout(Layout* layout) = 0; |
| | | |
| | | /** |
| | | * Set the threshold priority of this Appender. The Appender will not |
| | | * appender LoggingEvents with a priority lower than the threshold. |
| | | * Use Priority::NOTSET to disable threshold checking. |
| | | * @param priority The priority to set. |
| | | **/ |
| | | virtual void setThreshold(Priority::Value priority); |
| | | |
| | | /** |
| | | * Get the threshold priority of this Appender. |
| | | * @returns the threshold |
| | | **/ |
| | | virtual Priority::Value getThreshold(); |
| | | |
| | | /** |
| | | * Set a Filter for this appender. |
| | | **/ |
| | | virtual void setFilter(Filter* filter); |
| | | |
| | | /** |
| | | * Get the Filter for this appender. |
| | | * @returns the filter, or NULL if no filter has been set. |
| | | **/ |
| | | virtual Filter* getFilter(); |
| | | |
| | | protected: |
| | | /** |
| | | * Log in Appender specific way. Subclasses of Appender should |
| | | * implement this method to perform actual logging. |
| | | * @param event The LoggingEvent to log. |
| | | **/ |
| | | virtual void _append(const LoggingEvent& event) = 0; |
| | | |
| | | |
| | | private: |
| | | Priority::Value _threshold; |
| | | Filter* _filter; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_APPENDERSKELETON_HH |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | |
| | | #if !defined(h_738a42b1_1502_4483_948a_a69e7bbbee6a) |
| | | #define h_738a42b1_1502_4483_948a_a69e7bbbee6a |
| | | |
| | | #include <string> |
| | | #include <map> |
| | | #include <memory> |
| | | #include "Portability.hh" |
| | | #include "Appender.hh" |
| | | #include "FactoryParams.hh" |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class LOG4CPP_EXPORT AppendersFactory |
| | | { |
| | | public: |
| | | typedef FactoryParams params_t; |
| | | typedef std::auto_ptr<Appender> (*create_function_t)(const params_t& params); |
| | | |
| | | static AppendersFactory& getInstance(); |
| | | void registerCreator(const std::string& class_name, create_function_t create_function); |
| | | std::auto_ptr<Appender> create(const std::string& class_name, const params_t& params); |
| | | bool registered(const std::string& class_name) const; |
| | | |
| | | private: |
| | | AppendersFactory(){}; |
| | | |
| | | typedef std::map<std::string, create_function_t> creators_t; |
| | | typedef creators_t::const_iterator const_iterator; |
| | | |
| | | creators_t creators_; |
| | | }; |
| | | } |
| | | |
| | | #endif // h_738a42b1_1502_4483_948a_a69e7bbbee6a |
New file |
| | |
| | | /* |
| | | * BasicConfigurator.hh |
| | | * |
| | | * Copyright 2002, Log4cpp Project. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | #ifndef _LOG4CPP_BASICCONFIGURATOR_HH |
| | | #define _LOG4CPP_BASICCONFIGURATOR_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | This class implements a trivial default configuration for log4cpp: |
| | | it adds a FileAppender that logs to stdout and uses a BasicLayout to |
| | | the root Category. |
| | | @since 0.3.2 |
| | | **/ |
| | | class LOG4CPP_EXPORT BasicConfigurator { |
| | | public: |
| | | |
| | | /** |
| | | Performs a minimal configuration of log4cpp. |
| | | **/ |
| | | static void configure(); |
| | | }; |
| | | } |
| | | |
| | | #endif |
New file |
| | |
| | | /* |
| | | * BasicLayout.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_BASICLAYOUT_HH |
| | | #define _LOG4CPP_BASICLAYOUT_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Layout.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * BasicLayout is a simple fixed format Layout implementation. |
| | | **/ |
| | | class LOG4CPP_EXPORT BasicLayout : public Layout { |
| | | public: |
| | | BasicLayout(); |
| | | virtual ~BasicLayout(); |
| | | |
| | | /** |
| | | * Formats the LoggingEvent in BasicLayout style:<br> |
| | | * "timeStamp priority category ndc: message" |
| | | **/ |
| | | virtual std::string format(const LoggingEvent& event); |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_BASICLAYOUT_HH |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_ebd0ee89_622d_4af1_9a9d_d0e057debe86) |
| | | #define h_ebd0ee89_622d_4af1_9a9d_d0e057debe86 |
| | | |
| | | #include <log4cpp/LayoutAppender.hh> |
| | | #include <log4cpp/TriggeringEventEvaluator.hh> |
| | | #include <list> |
| | | #include <memory> |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class LOG4CPP_EXPORT BufferingAppender : public LayoutAppender |
| | | { |
| | | public: |
| | | BufferingAppender(const std::string name, unsigned long max_size, std::auto_ptr<Appender> sink, |
| | | std::auto_ptr<TriggeringEventEvaluator> evaluator); |
| | | |
| | | virtual void close() { sink_->close(); } |
| | | |
| | | bool getLossy() const { return lossy_; } |
| | | void setLossy(bool lossy) { lossy_ = lossy; } |
| | | |
| | | protected: |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | private: |
| | | typedef std::list<LoggingEvent> queue_t; |
| | | |
| | | queue_t queue_; |
| | | unsigned long max_size_; |
| | | std::auto_ptr<Appender> sink_; |
| | | std::auto_ptr<TriggeringEventEvaluator> evaluator_; |
| | | bool lossy_; |
| | | |
| | | void dump(); |
| | | }; |
| | | } |
| | | |
| | | #endif // h_ebd0ee89_622d_4af1_9a9d_d0e057debe86 |
New file |
| | |
| | | /* |
| | | * Category.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_CATEGORY_HH |
| | | #define _LOG4CPP_CATEGORY_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Appender.hh> |
| | | #include <log4cpp/LoggingEvent.hh> |
| | | #include <log4cpp/Priority.hh> |
| | | #include <log4cpp/CategoryStream.hh> |
| | | #include <log4cpp/threading/Threading.hh> |
| | | #include <log4cpp/convenience.h> |
| | | |
| | | #include <map> |
| | | #include <vector> |
| | | #include <cstdarg> |
| | | #include <stdexcept> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * This is the central class in the log4j package. One of the distintive |
| | | * features of log4j (and hence log4cpp) are hierarchal categories and |
| | | * their evaluation. |
| | | **/ |
| | | class LOG4CPP_EXPORT Category { |
| | | friend class HierarchyMaintainer; |
| | | |
| | | public: |
| | | /** |
| | | * Return the root of the Category hierarchy. |
| | | * |
| | | * <p>The root category is always instantiated and available. It's |
| | | * name is the empty string. |
| | | |
| | | * <p>Unlike in log4j, calling <code>Category.getInstance("")</code> |
| | | * <em>does</em> retrieve the root category |
| | | * and not a category just under root named "". |
| | | * @returns The root category |
| | | **/ |
| | | static Category& getRoot(); |
| | | |
| | | /** |
| | | * Set the priority of the root Category. |
| | | * @param priority The new priority for the root Category |
| | | **/ |
| | | static void setRootPriority(Priority::Value priority); |
| | | |
| | | /** |
| | | * Get the priority of the <code>root</code> Category. |
| | | * @returns the priority of the root category |
| | | **/ |
| | | static Priority::Value getRootPriority() throw(); |
| | | |
| | | /** |
| | | * Instantiate a Category with name <code>name</code>. This |
| | | * method does not set priority of the category which is by |
| | | * default <code>Priority::NOTSET</code>. |
| | | * |
| | | * @param name The name of the category to retrieve. |
| | | **/ |
| | | static Category& getInstance(const std::string& name); |
| | | |
| | | /** |
| | | * If the named category exists (in the default hierarchy) then it |
| | | * returns a reference to the category, otherwise it returns NULL. |
| | | * @since 0.2.7 |
| | | **/ |
| | | static Category* exists(const std::string& name); |
| | | |
| | | /** |
| | | * Returns all the currently defined categories as a vector of |
| | | * Category pointers. Note: this function does not pass ownership |
| | | * of the categories in the vector to the caller, only the ownership |
| | | * of the vector. However vector<Category&>* is not legal C++, |
| | | * so we can't follow the default ownership conventions. |
| | | * |
| | | * <p>Unlike in log4j, the root category <em>is</em> included |
| | | * in the returned set. |
| | | * |
| | | * @since 0.3.2. Before 0.3.2 this method returned a std::set |
| | | **/ |
| | | static std::vector<Category*>* getCurrentCategories(); |
| | | |
| | | /** |
| | | * This method will remove all Appenders from Categories.XXX |
| | | **/ |
| | | static void shutdown(); |
| | | |
| | | /** |
| | | * This method will remove all Appenders from Categories.XXX and delete all appenders. |
| | | * Releases more memory than shutdown() by deleting appenders. |
| | | **/ |
| | | static void shutdownForced(); |
| | | |
| | | /** |
| | | * Destructor for Category. |
| | | **/ |
| | | virtual ~Category(); |
| | | |
| | | /** |
| | | * Return the category name. |
| | | * @returns The category name. |
| | | */ |
| | | virtual const std::string& getName() const throw(); |
| | | |
| | | /** |
| | | * Set the priority of this Category. |
| | | * @param priority The priority to set. Use Priority::NOTSET to let |
| | | * the category use its parents priority as effective priority. |
| | | * @exception std::invalid_argument if the caller tries to set |
| | | * Priority::NOTSET on the Root Category. |
| | | **/ |
| | | virtual void setPriority(Priority::Value priority); |
| | | |
| | | /** |
| | | * Returns the assigned Priority, if any, for this Category. |
| | | * @return Priority - the assigned Priority, can be Priority::NOTSET |
| | | **/ |
| | | virtual Priority::Value getPriority() const throw(); |
| | | |
| | | /** |
| | | * Starting from this Category, search the category hierarchy for a |
| | | * set priority and return it. Otherwise, return the priority |
| | | * of the root category. |
| | | * |
| | | * <p>The Category class is designed so that this method executes as |
| | | * quickly as possible. |
| | | **/ |
| | | virtual Priority::Value getChainedPriority() const throw(); |
| | | |
| | | /** |
| | | * Returns true if the chained priority of the Category is equal to |
| | | * or higher than given priority. |
| | | * @param priority The priority to compare with. |
| | | * @returns whether logging is enable for this priority. |
| | | **/ |
| | | virtual bool isPriorityEnabled(Priority::Value priority) const throw(); |
| | | |
| | | /** |
| | | * Adds an Appender to this Category. |
| | | * This method passes ownership from the caller to the Category. |
| | | * @since 0.2.7 |
| | | * @param appender The Appender to wich this category has to log. |
| | | * @exception std::invalid_argument if the appender is NULL. |
| | | **/ |
| | | virtual void addAppender(Appender* appender); |
| | | |
| | | /** |
| | | * Adds an Appender for this Category. |
| | | * This method does not pass ownership from the caller to the Category. |
| | | * @since 0.2.7 |
| | | * @param appender The Appender this category has to log to. |
| | | **/ |
| | | virtual void addAppender(Appender& appender); |
| | | |
| | | /** |
| | | * Adds an Appender to this Category. |
| | | * This method passes ownership from the caller to the Category. |
| | | * @deprecated use addAppender(Appender*) or removeAllAppenders() |
| | | * instead. |
| | | * @param appender The Appender this category has to log to or NULL |
| | | * to remove the current Appenders. |
| | | **/ |
| | | inline void setAppender(Appender* appender) { |
| | | if (appender) { |
| | | addAppender(appender); |
| | | } else { |
| | | removeAllAppenders(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * Adds an Appender for this Category. |
| | | * This method does not pass ownership from the caller to the Category. |
| | | * @deprecated use addAppender(Appender&) instead. |
| | | * @param appender The Appender this category has to log to. |
| | | **/ |
| | | inline void setAppender(Appender& appender) { |
| | | addAppender(appender); |
| | | }; |
| | | |
| | | /** |
| | | * Returns the first Appender for this Category, or NULL if no |
| | | * Appender has been set. |
| | | * @deprecated use getAppender(const std::string&) |
| | | * @returns The Appender. |
| | | **/ |
| | | virtual Appender* getAppender() const; |
| | | |
| | | /** |
| | | * Returns the specified Appender for this Category, or NULL if |
| | | * the Appender is not attached to this Category. |
| | | * @since 0.2.7 |
| | | * @returns The Appender. |
| | | **/ |
| | | virtual Appender* getAppender(const std::string& name) const; |
| | | |
| | | /** |
| | | * Returns the set of Appenders currently attached to this Catogory. |
| | | * @since 0.3.1 |
| | | * @returns The set of attached Appenders. |
| | | **/ |
| | | virtual AppenderSet getAllAppenders() const; |
| | | |
| | | /** |
| | | * Removes all appenders for this Category. |
| | | **/ |
| | | virtual void removeAllAppenders(); |
| | | |
| | | /** |
| | | * Removes specified appender for this Category. |
| | | * @since 0.2.7 |
| | | **/ |
| | | virtual void removeAppender(Appender* appender); |
| | | |
| | | /** |
| | | * Returns true if the Category owns the first Appender in its |
| | | * Appender set. In that case the Category destructor will delete |
| | | * the Appender. |
| | | * @deprecated use ownsAppender(Appender*) |
| | | **/ |
| | | virtual bool ownsAppender() const throw() { |
| | | return ownsAppender(getAppender()); |
| | | }; |
| | | |
| | | /** |
| | | * Returns true if the Category owns the Appender. In that case the |
| | | * Category destructor will delete the Appender. |
| | | * @since 0.2.7 |
| | | **/ |
| | | virtual bool ownsAppender(Appender* appender) const throw(); |
| | | |
| | | /** |
| | | * Call the appenders in the hierarchy starting at |
| | | * <code>this</code>. If no appenders could be found, emit a |
| | | * warning. |
| | | * |
| | | * <p>This method always calls all the appenders inherited form the |
| | | * hierracy circumventing any evaluation of whether to log or not to |
| | | * log the particular log request. |
| | | * |
| | | * @param event the LogginEvent to log. |
| | | **/ |
| | | virtual void callAppenders(const LoggingEvent& event) throw(); |
| | | |
| | | /** |
| | | * Set the additivity flag for this Category instance. |
| | | **/ |
| | | virtual void setAdditivity(bool additivity); |
| | | |
| | | /** |
| | | * Returns the additivity flag for this Category instance. |
| | | **/ |
| | | virtual bool getAdditivity() const throw(); |
| | | |
| | | /** |
| | | * Returns the parent category of this category, or NULL |
| | | * if the category is the root category. |
| | | * @return the parent category. |
| | | **/ |
| | | virtual Category* getParent() throw(); |
| | | |
| | | /** |
| | | * Returns the parent category of this category, or NULL |
| | | * if the category is the root category. |
| | | * @return the parent category. |
| | | **/ |
| | | virtual const Category* getParent() const throw(); |
| | | |
| | | /** |
| | | * Log a message with the specified priority. |
| | | * @param priority The priority of this log message. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | virtual void log(Priority::Value priority, const char* stringFormat, |
| | | ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with the specified priority. |
| | | * @param priority The priority of this log message. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | virtual void log(Priority::Value priority, |
| | | const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Log a message with the specified priority. |
| | | * @since 0.2.7 |
| | | * @param priority The priority of this log message. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param va The arguments for stringFormat. |
| | | **/ |
| | | virtual void logva(Priority::Value priority, |
| | | const char* stringFormat, |
| | | va_list va) throw(); |
| | | |
| | | /** |
| | | * Log a message with debug priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void debug(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with debug priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void debug(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority DEBUG. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isDebugEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::DEBUG); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority DEBUG. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream debugStream() { |
| | | return getStream(Priority::DEBUG); |
| | | } |
| | | |
| | | /** |
| | | * Log a message with info priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void info(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with info priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void info(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority INFO. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isInfoEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::INFO); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority INFO. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream infoStream() { |
| | | return getStream(Priority::INFO); |
| | | } |
| | | |
| | | /** |
| | | * Log a message with notice priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void notice(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with notice priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void notice(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority NOTICE. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isNoticeEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::NOTICE); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority NOTICE. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream noticeStream() { |
| | | return getStream(Priority::NOTICE); |
| | | } |
| | | |
| | | /** |
| | | * Log a message with warn priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void warn(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with warn priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void warn(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority WARN. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isWarnEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::WARN); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority WARN. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream warnStream() { |
| | | return getStream(Priority::WARN); |
| | | }; |
| | | |
| | | /** |
| | | * Log a message with error priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void error(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with error priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void error(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority ERROR. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isErrorEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::ERROR); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority ERROR. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream errorStream() { |
| | | return getStream(Priority::ERROR); |
| | | }; |
| | | |
| | | /** |
| | | * Log a message with crit priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void crit(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with crit priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void crit(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority CRIT. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isCritEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::CRIT); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority CRIT. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream critStream() { |
| | | return getStream(Priority::CRIT); |
| | | }; |
| | | |
| | | /** |
| | | * Log a message with alert priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void alert(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with alert priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void alert(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority ALERT. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isAlertEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::ALERT); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority ALERT. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream alertStream() throw() { |
| | | return getStream(Priority::ALERT); |
| | | }; |
| | | |
| | | /** |
| | | * Log a message with emerg priority. |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void emerg(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with emerg priority. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void emerg(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority EMERG. |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isEmergEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::EMERG); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority EMERG. |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream emergStream() { |
| | | return getStream(Priority::EMERG); |
| | | }; |
| | | |
| | | /** |
| | | * Log a message with fatal priority. |
| | | * NB. priority 'fatal' is equivalent to 'emerg'. |
| | | * @since 0.2.7 |
| | | * @param stringFormat Format specifier for the string to write |
| | | * in the log file. |
| | | * @param ... The arguments for stringFormat |
| | | **/ |
| | | void fatal(const char* stringFormat, ...) throw(); |
| | | |
| | | /** |
| | | * Log a message with fatal priority. |
| | | * NB. priority 'fatal' is equivalent to 'emerg'. |
| | | * @since 0.2.7 |
| | | * @param message string to write in the log file |
| | | **/ |
| | | void fatal(const std::string& message) throw(); |
| | | |
| | | /** |
| | | * Return true if the Category will log messages with priority FATAL. |
| | | * NB. priority 'fatal' is equivalent to 'emerg'. |
| | | * @since 0.2.7 |
| | | * @returns Whether the Category will log. |
| | | **/ |
| | | inline bool isFatalEnabled() const throw() { |
| | | return isPriorityEnabled(Priority::FATAL); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with priority FATAL. |
| | | * NB. priority 'fatal' is equivalent to 'emerg'. |
| | | * @since 0.2.7 |
| | | * @returns The CategoryStream. |
| | | **/ |
| | | inline CategoryStream fatalStream() { |
| | | return getStream(Priority::FATAL); |
| | | }; |
| | | |
| | | /** |
| | | * Return a CategoryStream with given Priority. |
| | | * @param priority The Priority of the CategoryStream. |
| | | * @returns The requested CategoryStream. |
| | | **/ |
| | | virtual CategoryStream getStream(Priority::Value priority); |
| | | |
| | | /** |
| | | * Return a CategoryStream with given Priority. |
| | | * @param priority The Priority of the CategoryStream. |
| | | * @returns The requested CategoryStream. |
| | | **/ |
| | | virtual CategoryStream operator<<(Priority::Value priority); |
| | | |
| | | protected: |
| | | |
| | | /** |
| | | * Constructor |
| | | * @param name the fully qualified name of this Category |
| | | * @param parent the parent of this parent, or NULL for the root |
| | | * Category |
| | | * @param priority the priority for this Category. Defaults to |
| | | * Priority::NOTSET |
| | | **/ |
| | | Category(const std::string& name, Category* parent, |
| | | Priority::Value priority = Priority::NOTSET); |
| | | |
| | | virtual void _logUnconditionally(Priority::Value priority, |
| | | const char* format, |
| | | va_list arguments) throw(); |
| | | |
| | | /** |
| | | * Unconditionally log a message with the specified priority. |
| | | * @param priority The priority of this log message. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | virtual void _logUnconditionally2(Priority::Value priority, |
| | | const std::string& message) throw(); |
| | | |
| | | private: |
| | | |
| | | /* prevent copying and assignment */ |
| | | Category(const Category& other); |
| | | Category& operator=(const Category& other); |
| | | |
| | | /** The name of this category. */ |
| | | const std::string _name; |
| | | |
| | | /** |
| | | * The parent of this category. All categories have al least one |
| | | * ancestor which is the root category. |
| | | **/ |
| | | Category* _parent; |
| | | |
| | | /** |
| | | * The assigned priority of this category. |
| | | **/ |
| | | volatile Priority::Value _priority; |
| | | |
| | | typedef std::map<Appender *, bool> OwnsAppenderMap; |
| | | |
| | | /** |
| | | * Returns the iterator to the Appender if the Category owns the |
| | | * Appender. In that case the Category destructor will delete the |
| | | * Appender. |
| | | **/ |
| | | |
| | | virtual bool ownsAppender(Appender* appender, |
| | | OwnsAppenderMap::iterator& i2) throw(); |
| | | |
| | | AppenderSet _appender; |
| | | mutable threading::Mutex _appenderSetMutex; |
| | | |
| | | /** |
| | | * Whether the category holds the ownership of the appender. If so, |
| | | * it deletes the appender in its destructor. |
| | | **/ |
| | | |
| | | OwnsAppenderMap _ownsAppender; |
| | | |
| | | /** |
| | | * Additivity is set to true by default, i.e. a child inherits its |
| | | * ancestor's appenders by default. |
| | | */ |
| | | volatile bool _isAdditive; |
| | | |
| | | }; |
| | | |
| | | } |
| | | #endif // _LOG4CPP_CATEGORY_HH |
New file |
| | |
| | | /* |
| | | * CategoryStream.hh |
| | | * |
| | | * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2001, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_CATEGORYSTREAM_HH |
| | | #define _LOG4CPP_CATEGORYSTREAM_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Priority.hh> |
| | | #include <ios> |
| | | #ifdef LOG4CPP_HAVE_SSTREAM |
| | | #include <sstream> |
| | | #endif |
| | | #include <log4cpp/Manipulator.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | class LOG4CPP_EXPORT Category; |
| | | class LOG4CPP_EXPORT CategoryStream; |
| | | /** |
| | | * eol manipulator |
| | | **/ |
| | | LOG4CPP_EXPORT CategoryStream& eol (CategoryStream& os); |
| | | |
| | | /** |
| | | * left manipulator |
| | | **/ |
| | | LOG4CPP_EXPORT CategoryStream& left (CategoryStream& os); |
| | | |
| | | /** |
| | | * This class enables streaming simple types and objects to a category. |
| | | * Use category.errorStream(), etc. to obtain a CategoryStream class. |
| | | **/ |
| | | class LOG4CPP_EXPORT CategoryStream { |
| | | public: |
| | | |
| | | /** |
| | | * Construct a CategoryStream for given Category with given priority. |
| | | * @param category The category this stream will send log messages to. |
| | | * @param priority The priority the log messages will get or |
| | | * Priority::NOTSET to silently discard any streamed in messages. |
| | | **/ |
| | | CategoryStream(Category& category, Priority::Value priority); |
| | | |
| | | /** |
| | | * Destructor for CategoryStream |
| | | **/ |
| | | ~CategoryStream(); |
| | | |
| | | /** |
| | | * Returns the destination Category for this stream. |
| | | * @returns The Category. |
| | | **/ |
| | | inline Category& getCategory() const { return _category; }; |
| | | |
| | | /** |
| | | * Returns the priority for this stream. |
| | | * @returns The priority. |
| | | **/ |
| | | inline Priority::Value getPriority() const throw() { |
| | | return _priority; |
| | | }; |
| | | |
| | | /** |
| | | * Flush the contents of the stream buffer to the Category and |
| | | * empties the buffer. |
| | | **/ |
| | | void flush(); |
| | | |
| | | /** |
| | | * Stream in arbitrary types and objects. |
| | | * @param t The value or object to stream in. |
| | | * @returns A reference to itself. |
| | | **/ |
| | | template<typename T> |
| | | CategoryStream& operator<<(const T& t) { |
| | | if (getPriority() != Priority::NOTSET) { |
| | | if (!_buffer) { |
| | | if (!(_buffer = new std::ostringstream)) { |
| | | // XXX help help help |
| | | } |
| | | } |
| | | (*_buffer) << t; |
| | | } |
| | | return *this; |
| | | } |
| | | |
| | | CategoryStream& operator<<(const char* t); |
| | | |
| | | template<typename T> |
| | | CategoryStream& operator<<(const std::string& t) { |
| | | if (getPriority() != Priority::NOTSET) { |
| | | if (!_buffer) { |
| | | if (!(_buffer = new std::ostringstream)) { |
| | | // XXX help help help |
| | | } |
| | | } |
| | | (*_buffer) << t; |
| | | } |
| | | return *this; |
| | | } |
| | | #if LOG4CPP_HAS_WCHAR_T != 0 |
| | | template<typename T> |
| | | CategoryStream& operator<<(const std::wstring& t) { |
| | | if (getPriority() != Priority::NOTSET) { |
| | | if (!_wbuffer) { |
| | | if (!(_wbuffer = new std::wostringstream)) { |
| | | // XXX help help help |
| | | } |
| | | } |
| | | (*_wbuffer) << t; |
| | | } |
| | | return *this; |
| | | } |
| | | #endif |
| | | /** |
| | | * Set the width output on CategoryStream |
| | | **/ |
| | | std::streamsize width(std::streamsize wide ); |
| | | |
| | | |
| | | private: |
| | | Category& _category; |
| | | Priority::Value _priority; |
| | | union { |
| | | std::ostringstream* _buffer; |
| | | #if LOG4CPP_HAS_WCHAR_T != 0 |
| | | std::wostringstream* _wbuffer; |
| | | #endif |
| | | }; |
| | | |
| | | public: |
| | | typedef CategoryStream& (*cspf) (CategoryStream&); |
| | | |
| | | CategoryStream& operator << (cspf); |
| | | LOG4CPP_EXPORT friend CategoryStream& eol (CategoryStream& os); |
| | | LOG4CPP_EXPORT friend CategoryStream& left (CategoryStream& os); |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_CATEGORYSTREAM_HH |
New file |
| | |
| | | /* |
| | | * Configurator.hh |
| | | * |
| | | * Copyright 2001, Glen Scott. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | #ifndef _LOG4CPP_CONFIGURATOR_HH |
| | | #define _LOG4CPP_CONFIGURATOR_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Export.hh> |
| | | #include <string> |
| | | #include <stdexcept> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * Exception class for configuration. |
| | | */ |
| | | class LOG4CPP_EXPORT ConfigureFailure : public std::runtime_error { |
| | | public: |
| | | /** |
| | | * Constructor. |
| | | * @param reason String containing the description of the exception. |
| | | */ |
| | | ConfigureFailure(const std::string& reason); |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_CONFIGURATOR_HH |
New file |
| | |
| | | /* |
| | | * DailyRollingFileAppender.hh |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_DAILYROLLINGFILEAPPENDER_HH |
| | | #define _LOG4CPP_DAILYROLLINGFILEAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/FileAppender.hh> |
| | | #include <string> |
| | | #include <stdarg.h> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | DailyRollingFileAppender is a FileAppender that rolls over the logfile once |
| | | the next day starts. |
| | | @since 1.1.2 |
| | | **/ |
| | | class LOG4CPP_EXPORT DailyRollingFileAppender : public FileAppender { |
| | | public: |
| | | DailyRollingFileAppender(const std::string& name, |
| | | const std::string& fileName, |
| | | unsigned int maxDaysToKeep = maxDaysToKeepDefault, |
| | | bool append = true, |
| | | mode_t mode = 00644); |
| | | |
| | | virtual void setMaxDaysToKeep(unsigned int maxDaysToKeep); |
| | | virtual unsigned int getMaxDaysToKeep() const; |
| | | |
| | | virtual void rollOver(); |
| | | |
| | | static unsigned int maxDaysToKeepDefault; |
| | | protected: |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | unsigned int _maxDaysToKeep; |
| | | // last log's file creation time (or last modification if appender just created) |
| | | struct tm _logsTime; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_DAILYROLLINGFILEAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_EXPORT_HH |
| | | #define _LOG4CPP_EXPORT_HH |
| | | |
| | | #ifdef LOG4CPP_HAS_DLL |
| | | # ifdef LOG4CPP_BUILD_DLL |
| | | # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) |
| | | # define LOG4CPP_EXPORT __declspec(dllexport) |
| | | # else |
| | | # define LOG4CPP_EXPORT |
| | | # endif |
| | | # else |
| | | # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) |
| | | # define LOG4CPP_EXPORT __declspec(dllimport) |
| | | # else |
| | | # define LOG4CPP_EXPORT |
| | | # endif |
| | | # endif |
| | | #else |
| | | # define LOG4CPP_EXPORT |
| | | #endif |
| | | |
| | | #endif // _LOG4CPP_EXPORT_HH |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_3e645482_ae6a_43e5_8f81_abbc4200212d) |
| | | #define h_3e645482_ae6a_43e5_8f81_abbc4200212d |
| | | |
| | | #include <map> |
| | | #include <string> |
| | | #include <sstream> |
| | | #include <stdexcept> |
| | | #include "Portability.hh" |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class FactoryParams; |
| | | namespace details |
| | | { |
| | | class base_validator_data |
| | | { |
| | | public: |
| | | base_validator_data(const char* tag, const FactoryParams* params) : tag_(tag), params_(params){} |
| | | |
| | | protected: |
| | | const char* tag_; |
| | | const FactoryParams* params_; |
| | | |
| | | template<typename T> |
| | | void assign(const std::string& param_value, T& value) const |
| | | { |
| | | assign_impl(param_value, value); |
| | | } |
| | | |
| | | template<typename T> |
| | | void assign_impl(const std::string& param_value, T& value) const |
| | | { |
| | | std::stringstream s; |
| | | s << param_value; |
| | | s >> value; |
| | | } |
| | | |
| | | void assign_impl(const std::string& param_value, std::string& value) const |
| | | { |
| | | value = param_value; |
| | | } |
| | | |
| | | void throw_error(const char* param_name) const |
| | | { |
| | | std::stringstream s; |
| | | s << "Property '" << param_name << "' required to configure " << tag_; |
| | | throw std::runtime_error(s.str()); |
| | | } |
| | | }; |
| | | |
| | | class parameter_validator; |
| | | } |
| | | |
| | | class LOG4CPP_EXPORT FactoryParams |
| | | { |
| | | typedef std::map<std::string, std::string> storage_t; |
| | | |
| | | storage_t storage_; |
| | | |
| | | public: |
| | | typedef storage_t::const_iterator const_iterator; |
| | | |
| | | const std::string& operator[](const std::string& v) const; |
| | | std::string& operator[](const std::string& v) { return storage_[v]; } |
| | | details::parameter_validator get_for(const char* tag) const; |
| | | const_iterator find(const std::string& t) const; |
| | | const_iterator begin() const { return storage_.begin(); } |
| | | const_iterator end() const { return storage_.end(); } |
| | | }; |
| | | |
| | | namespace details |
| | | { |
| | | class optional_params_validator; |
| | | class required_params_validator : public base_validator_data |
| | | { |
| | | public: |
| | | required_params_validator(const char* tag, const FactoryParams* params) : base_validator_data(tag, params) {} |
| | | |
| | | #if defined(_MSC_VER) && _MSC_VER < 1300 |
| | | template<typename T> |
| | | optional_params_validator optional(const char* param, T& value) const { optional_params_validator v(tag_, params_); v(param, value); return v; } |
| | | #else |
| | | template<typename T> |
| | | optional_params_validator optional(const char* param, T& value) const; |
| | | #endif |
| | | |
| | | template<typename T> |
| | | const required_params_validator& operator()(const char* param, T& value) const |
| | | { |
| | | FactoryParams::const_iterator i = params_->find(param); |
| | | if (i != params_->end()) |
| | | assign(i->second, value); |
| | | else |
| | | throw_error(param); |
| | | |
| | | return *this; |
| | | } |
| | | |
| | | }; |
| | | |
| | | class optional_params_validator : public base_validator_data |
| | | { |
| | | public: |
| | | optional_params_validator(const char* tag, const FactoryParams* params) : base_validator_data(tag, params) {} |
| | | |
| | | template<typename T> |
| | | required_params_validator required(const char* param, T& value) const { required_params_validator v(tag_, params_); v(param, value); return v; } |
| | | |
| | | template<typename T> |
| | | const optional_params_validator& operator()(const char* param, T& value) const |
| | | { |
| | | FactoryParams::const_iterator i = params_->find(param); |
| | | if (i != params_->end()) |
| | | assign(i->second, value); |
| | | |
| | | return *this; |
| | | |
| | | } |
| | | }; |
| | | |
| | | class parameter_validator : public base_validator_data |
| | | { |
| | | public: |
| | | parameter_validator(const char* tag, const FactoryParams* params) : base_validator_data(tag, params) {} |
| | | |
| | | template<typename T> |
| | | required_params_validator required(const char* param, T& value) const { required_params_validator v(tag_, params_); v(param, value); return v; } |
| | | |
| | | template<typename T> |
| | | optional_params_validator optional(const char* param, T& value) const { optional_params_validator v(tag_, params_); v(param, value); return v; } |
| | | }; |
| | | |
| | | #if !(defined(_MSC_VER) && _MSC_VER < 1300) |
| | | template<typename T> |
| | | optional_params_validator |
| | | required_params_validator::optional(const char* param, T& value) const |
| | | { |
| | | optional_params_validator v(tag_, params_); |
| | | v(param, value); |
| | | return v; |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | inline details::parameter_validator FactoryParams::get_for(const char* tag) const |
| | | { |
| | | return details::parameter_validator(tag, this); |
| | | } |
| | | } |
| | | |
| | | #endif // h_3e645482_ae6a_43e5_8f81_abbc4200212d |
New file |
| | |
| | | /* |
| | | * FileAppender.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_FILEAPPENDER_HH |
| | | #define _LOG4CPP_FILEAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/LayoutAppender.hh> |
| | | #include <string> |
| | | #include <stdarg.h> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | class LOG4CPP_EXPORT FileAppender : public LayoutAppender { |
| | | public: |
| | | |
| | | /** |
| | | Constructs a FileAppender. |
| | | @param name the name of the Appender. |
| | | @param fileName the name of the file to which the Appender has |
| | | to log. |
| | | @param append whether the Appender has to truncate the file or |
| | | just append to it if it already exists. Defaults to 'true'. |
| | | @param mode file mode to open the logfile with. Defaults to 00644. |
| | | **/ |
| | | FileAppender(const std::string& name, const std::string& fileName, |
| | | bool append = true, mode_t mode = 00644); |
| | | |
| | | /** |
| | | Constructs a FileAppender to an already open file descriptor. |
| | | @param name the name of the Appender. |
| | | @param fd the file descriptor to which the Appender has to log. |
| | | **/ |
| | | FileAppender(const std::string& name, int fd); |
| | | virtual ~FileAppender(); |
| | | |
| | | /** |
| | | Reopens the logfile. |
| | | This can be useful for logfiles that are rotated externally, |
| | | e.g. by logrotate. This method is a NOOP for FileAppenders that |
| | | have been constructed with a file descriptor. |
| | | @returns true if the reopen succeeded. |
| | | **/ |
| | | virtual bool reopen(); |
| | | |
| | | /** |
| | | Closes the logfile. |
| | | **/ |
| | | virtual void close(); |
| | | |
| | | /** |
| | | Sets the append vs truncate flag. |
| | | NB. currently the FileAppender opens the logfile in the |
| | | constructor. Therefore this method is too late to influence the |
| | | first file opening. We'll need something similar to log4j's |
| | | activateOptions(). |
| | | @param append false to truncate, true to append |
| | | **/ |
| | | virtual void setAppend(bool append); |
| | | |
| | | /** |
| | | Gets the value of the 'append' option. |
| | | **/ |
| | | virtual bool getAppend() const; |
| | | |
| | | /** |
| | | Sets the file open mode. |
| | | **/ |
| | | virtual void setMode(mode_t mode); |
| | | |
| | | /** |
| | | Gets the file open mode. |
| | | **/ |
| | | virtual mode_t getMode() const; |
| | | |
| | | protected: |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | const std::string _fileName; |
| | | int _fd; |
| | | int _flags; |
| | | mode_t _mode; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_FILEAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * Filter.hh |
| | | * |
| | | * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2001, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_FILTER_HH |
| | | #define _LOG4CPP_FILTER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/LoggingEvent.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | Users should extend this class to implement customized logging |
| | | event filtering. Note that log4cpp::Category and |
| | | lof4cpp::Appender have built-in filtering rules. It is suggested |
| | | that you first use and understand the built-in rules before rushing |
| | | to write your own custom filters. |
| | | |
| | | <p>This abstract class assumes and also imposes that filters be |
| | | organized in a linear chain. The <code>decide(LoggingEvent)</code> |
| | | method of each filter is called sequentially, in the order of their |
| | | addition to the chain. |
| | | |
| | | <p>The <code>decide(LoggingEvent)</code> method must return a |
| | | Decision value, either DENY, NEUTRAL or ACCCEPT. |
| | | |
| | | <p>If the value DENY is returned, then the log event is |
| | | dropped immediately without consulting with the remaining |
| | | filters. |
| | | |
| | | <p>If the value NEUTRAL is returned, then the next filter |
| | | in the chain is consulted. If there are no more filters in the |
| | | chain, then the log event is logged. Thus, in the presence of no |
| | | filters, the default behaviour is to log all logging events. |
| | | |
| | | <p>If the value ACCEPT is returned, then the log |
| | | event is logged without consulting the remaining filters. |
| | | |
| | | <p>The philosophy of log4cpp filters is largely inspired from the |
| | | Linux ipchains. |
| | | **/ |
| | | |
| | | class LOG4CPP_EXPORT Filter { |
| | | public: |
| | | |
| | | typedef enum { DENY = -1, |
| | | NEUTRAL = 0, |
| | | ACCEPT = 1 |
| | | } Decision; |
| | | |
| | | /** |
| | | * Default Constructor for Filter |
| | | **/ |
| | | Filter(); |
| | | |
| | | /** |
| | | * Destructor for Filter |
| | | **/ |
| | | virtual ~Filter(); |
| | | |
| | | /** |
| | | * Set the next Filter in the Filter chain |
| | | * @param filter The filter to chain |
| | | **/ |
| | | virtual void setChainedFilter(Filter* filter); |
| | | |
| | | /** |
| | | * Get the next Filter in the Filter chain |
| | | * @return The next Filter or NULL if the current filter is the last |
| | | * in the chain |
| | | **/ |
| | | virtual Filter* getChainedFilter(); |
| | | |
| | | /** |
| | | * Get the last Filter in the Filter chain |
| | | * @return The last Filter in the Filter chain |
| | | **/ |
| | | virtual Filter* getEndOfChain(); |
| | | |
| | | /** |
| | | * Add a Filter to the end of the Filter chain. Convience method for |
| | | * getEndOfChain()->setChainedFilter(filter). |
| | | * @param filter The filter to add to the end of the chain. |
| | | **/ |
| | | virtual void appendChainedFilter(Filter* filter); |
| | | |
| | | /** |
| | | * Decide whether to accept or deny a LoggingEvent. This method will |
| | | * walk the entire chain until a non neutral decision has been made |
| | | * or the end of the chain has been reached. |
| | | * @param event The LoggingEvent to decide on. |
| | | * @return The Decision |
| | | **/ |
| | | virtual Decision decide(const LoggingEvent& event); |
| | | |
| | | protected: |
| | | /** |
| | | * Decide whether <b>this</b> Filter accepts or denies the given |
| | | * LoggingEvent. Actual implementation of Filter should override this |
| | | * method and not <code>decide(LoggingEvent&)</code>. |
| | | * @param event The LoggingEvent to decide on. |
| | | * @return The Decision |
| | | **/ |
| | | virtual Decision _decide(const LoggingEvent& event) = 0; |
| | | |
| | | private: |
| | | Filter* _chainedFilter; |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | #endif // _LOG4CPP_FILTER_HH |
New file |
| | |
| | | /* |
| | | * FixedContextCategory.hh |
| | | * |
| | | * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2001, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_FIXEDCONTEXTCATEGORY_HH |
| | | #define _LOG4CPP_FIXEDCONTEXTCATEGORY_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Category.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * This Category subclass replaces the NDC field in LoggingEvents with |
| | | * a fixed context string. All handling of Appenders, etc. is delgated |
| | | * to the 'normal' Category with the same name. Its intended use is |
| | | * for object instances that serve a single client: they contruct a |
| | | * FixedContextCategory with the client identifier as context. |
| | | * Unlike with regular Category instances one has to explicitly create |
| | | * FixedContextCategory instances using the constructor. This also |
| | | * implies one has to take cake of destruction of the instance as well. |
| | | * @since 0.2.4 |
| | | **/ |
| | | class LOG4CPP_EXPORT FixedContextCategory : public Category { |
| | | |
| | | public: |
| | | |
| | | /** |
| | | * Constructor |
| | | * @param name the fully qualified name of this Categories delegate |
| | | * Category. |
| | | * @param context the context to fill the NDC field of LoggingEvents |
| | | * with. |
| | | **/ |
| | | FixedContextCategory(const std::string& name, |
| | | const std::string& context = ""); |
| | | |
| | | |
| | | /** |
| | | * Destructor for Category. |
| | | **/ |
| | | virtual ~FixedContextCategory(); |
| | | |
| | | /** |
| | | * Set the context string used as NDC. |
| | | * @param context the context string |
| | | **/ |
| | | virtual void setContext(const std::string& context); |
| | | |
| | | /** |
| | | * Return the context string used as NDC. |
| | | * @return the context string. |
| | | **/ |
| | | virtual std::string getContext() const; |
| | | |
| | | /** |
| | | * Returns the assigned Priority, if any, for this Category. |
| | | * @return Priority - the assigned Priority, can be Priority::NOTSET |
| | | **/ |
| | | virtual Priority::Value getPriority() const throw(); |
| | | |
| | | /** |
| | | * Starting from this Category, search the category hierarchy for a |
| | | * set priority and return it. Otherwise, return the priority |
| | | * of the root category. |
| | | * |
| | | * <p>The Category class is designed so that this method executes as |
| | | * quickly as possible. |
| | | **/ |
| | | virtual Priority::Value getChainedPriority() const throw(); |
| | | |
| | | /** |
| | | * For the moment this method does nothing. |
| | | **/ |
| | | virtual void addAppender(Appender* appender) throw(); |
| | | |
| | | /** |
| | | * For the moment this method does nothing. |
| | | **/ |
| | | virtual void addAppender(Appender& appender); |
| | | |
| | | /** |
| | | * Returns the Appender for this Category, or NULL if no Appender has |
| | | * been set. |
| | | * @returns The Appender. |
| | | **/ |
| | | virtual Appender* getAppender() const; |
| | | |
| | | /** |
| | | * Returns the specified Appender for this Category, or NULL if |
| | | * the Appender is not attached to this Category. |
| | | * @since 0.2.7 |
| | | * @returns The Appender. |
| | | **/ |
| | | virtual Appender* getAppender(const std::string& name) const; |
| | | |
| | | /** |
| | | * Returns the set of Appenders currently attached to this Catogory. |
| | | * @since 0.3.1 |
| | | * @returns The set of attached Appenders. |
| | | **/ |
| | | virtual AppenderSet getAllAppenders() const; |
| | | |
| | | /** |
| | | * Removes all appenders set for this Category. Currently a Category |
| | | * can have only one appender, but this may change in the future. |
| | | **/ |
| | | virtual void removeAllAppenders(); |
| | | |
| | | /** |
| | | * FixedContextAppenders cannot own Appenders. |
| | | * @returns false |
| | | **/ |
| | | virtual bool ownsAppender() const throw(); |
| | | |
| | | /** |
| | | * FixedContextAppenders cannot own Appenders. |
| | | * @returns false |
| | | **/ |
| | | virtual bool ownsAppender(Appender* appender) |
| | | const throw(); |
| | | |
| | | /** |
| | | * Call the appenders in the hierarchy starting at |
| | | * <code>this</code>. If no appenders could be found, emit a |
| | | * warning. |
| | | * |
| | | * <p>This method always calls all the appenders inherited form the |
| | | * hierracy circumventing any evaluation of whether to log or not to |
| | | * log the particular log request. |
| | | * |
| | | * @param event The LoggingEvent to log. |
| | | **/ |
| | | virtual void callAppenders(const LoggingEvent& event) throw(); |
| | | |
| | | /** |
| | | * Set the additivity flag for this Category instance. |
| | | **/ |
| | | virtual void setAdditivity(bool additivity); |
| | | |
| | | /** |
| | | * Returns the additivity flag for this Category instance. |
| | | **/ |
| | | virtual bool getAdditivity() const throw(); |
| | | |
| | | protected: |
| | | |
| | | /** |
| | | * Unconditionally log a message with the specified priority. |
| | | * @param priority The priority of this log message. |
| | | * @param message string to write in the log file |
| | | **/ |
| | | virtual void _logUnconditionally2(Priority::Value priority, |
| | | const std::string& message) throw(); |
| | | |
| | | private: |
| | | |
| | | /** |
| | | * The delegate category of this FixedContextCategory. |
| | | **/ |
| | | Category& _delegate; |
| | | |
| | | /** The context of this FixedContextCategory. */ |
| | | std::string _context; |
| | | |
| | | }; |
| | | |
| | | } |
| | | #endif // _LOG4CPP_FIXEDCONTEXTCATEGORY_HH |
New file |
| | |
| | | /* |
| | | * HierarchyMaintainer.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_HIERARCHYMAINTAINER_HH |
| | | #define _LOG4CPP_HIERARCHYMAINTAINER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <map> |
| | | #include <vector> |
| | | #include <log4cpp/Category.hh> |
| | | #include <log4cpp/threading/Threading.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * HierarchyMaintainer is an internal log4cpp class. It is responsible |
| | | * for maintaining the hierarchy of Categories. Applications should |
| | | * not have to use this class directly. |
| | | **/ |
| | | class HierarchyMaintainer { |
| | | friend class Log4cppCleanup; |
| | | |
| | | public: |
| | | typedef std::map<std::string, Category*> CategoryMap; |
| | | typedef void (*shutdown_fun_ptr)(); |
| | | |
| | | static HierarchyMaintainer& getDefaultMaintainer(); |
| | | |
| | | HierarchyMaintainer(); |
| | | virtual ~HierarchyMaintainer(); |
| | | virtual Category* getExistingInstance(const std::string& name); |
| | | virtual Category& getInstance(const std::string& name); |
| | | virtual std::vector<Category*>* getCurrentCategories() const; |
| | | virtual void shutdown(); |
| | | void register_shutdown_handler(shutdown_fun_ptr handler); |
| | | virtual void deleteAllCategories(); |
| | | |
| | | protected: |
| | | virtual Category* _getExistingInstance(const std::string& name); |
| | | virtual Category& _getInstance(const std::string& name); |
| | | CategoryMap _categoryMap; |
| | | mutable threading::Mutex _categoryMutex; |
| | | |
| | | private: |
| | | typedef std::vector<shutdown_fun_ptr> handlers_t; |
| | | |
| | | static HierarchyMaintainer* _defaultMaintainer; |
| | | handlers_t handlers_; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_HIERARCHYMAINTAINER_HH |
New file |
| | |
| | | /* |
| | | * IdsaAppender.hh |
| | | * |
| | | * Copyright 2000, Marc Welz |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_IDSAAPPENDER_HH |
| | | #define _LOG4CPP_IDSAAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <stdarg.h> |
| | | #include <idsa.h> |
| | | #include <log4cpp/AppenderSkeleton.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * IdsaAppender is an Appender that sends LoggingEvents to the IDS/A |
| | | * logger and reference monitor by Marc Welz. |
| | | * See http://jade.cs.uct.ac.za/idsa/ for more information on IDS/A. |
| | | **/ |
| | | class IdsaAppender : public AppenderSkeleton { |
| | | public: |
| | | |
| | | /** |
| | | * Instantiate an IdsaAppender with given name and name. |
| | | * Unlike the syslog API, idsa allows multiple connections. |
| | | * @param name The name of the Appender |
| | | * @param idsaName The service parameter of idsa |
| | | **/ |
| | | IdsaAppender(const std::string& name, const std::string& idsaName); |
| | | virtual ~IdsaAppender(); |
| | | |
| | | /** |
| | | * Calls idsa_open() and idsa_close() |
| | | **/ |
| | | virtual bool reopen(); |
| | | |
| | | /** |
| | | * Calls idsa_close() |
| | | **/ |
| | | virtual void close(); |
| | | |
| | | /** |
| | | * The IdsaAppender does its own Layout. |
| | | * @returns false |
| | | **/ |
| | | virtual bool requiresLayout() const; |
| | | |
| | | virtual void setLayout(Layout* layout); |
| | | |
| | | protected: |
| | | |
| | | /** |
| | | * Calls idsa_open(). |
| | | **/ |
| | | virtual void open(); |
| | | |
| | | /** |
| | | * Sends a LoggingEvent to idsa. |
| | | * @param event the LoggingEvent to log. |
| | | **/ |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | const std::string _idsaName; |
| | | |
| | | IDSA_CONNECTION *_idsaConnection; |
| | | |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_IDSAAPPENDER_HH |
| | | |
New file |
| | |
| | | /* |
| | | * Layout.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_LAYOUT_HH |
| | | #define _LOG4CPP_LAYOUT_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/LoggingEvent.hh> |
| | | #include <string> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * Extend this abstract class to create your own log layout format. |
| | | **/ |
| | | class LOG4CPP_EXPORT Layout { |
| | | public: |
| | | /** |
| | | * Destructor for Layout. |
| | | **/ |
| | | virtual ~Layout() { }; |
| | | |
| | | /** |
| | | * Formats the LoggingEvent data to a string that appenders can log. |
| | | * Implement this method to create your own layout format. |
| | | * @param event The LoggingEvent. |
| | | * @returns an appendable string. |
| | | **/ |
| | | virtual std::string format(const LoggingEvent& event) = 0; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_LAYOUT_HH |
New file |
| | |
| | | /* |
| | | * LayoutAppender.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_LAYOUTAPPENDER_HH |
| | | #define _LOG4CPP_LAYOUTAPPENDER_HH |
| | | |
| | | #include <string> |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/AppenderSkeleton.hh> |
| | | #include <log4cpp/BasicLayout.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * LayoutAppender is a common superclass for all Appenders that require |
| | | * a Layout. |
| | | **/ |
| | | class LOG4CPP_EXPORT LayoutAppender : public AppenderSkeleton { |
| | | public: |
| | | |
| | | typedef BasicLayout DefaultLayoutType; |
| | | |
| | | LayoutAppender(const std::string& name); |
| | | virtual ~LayoutAppender(); |
| | | |
| | | /** |
| | | * Check if the appender requires a layout. All LayoutAppenders do, |
| | | * therefore this method returns true for all subclasses. |
| | | * |
| | | * @returns true. |
| | | **/ |
| | | virtual bool requiresLayout() const; |
| | | virtual void setLayout(Layout* layout = NULL); |
| | | |
| | | protected: |
| | | /** |
| | | * Return the layout of the appender. |
| | | * This method is the Layout accessor for subclasses of LayoutAppender. |
| | | * @returns the Layout. |
| | | **/ |
| | | Layout& _getLayout(); |
| | | |
| | | private: |
| | | Layout* _layout; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_LAYOUTAPPENDER_HH |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_409ac787_0acf_47ff_ac15_3e9024d40315) |
| | | #define h_409ac787_0acf_47ff_ac15_3e9024d40315 |
| | | |
| | | #include <string> |
| | | #include <map> |
| | | #include <memory> |
| | | #include "Portability.hh" |
| | | #include "Layout.hh" |
| | | #include "FactoryParams.hh" |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class LOG4CPP_EXPORT LayoutsFactory |
| | | { |
| | | public: |
| | | typedef FactoryParams params_t; |
| | | typedef std::auto_ptr<Layout> (*create_function_t)(const params_t& params); |
| | | |
| | | static LayoutsFactory& getInstance(); |
| | | void registerCreator(const std::string& class_name, create_function_t create_function); |
| | | std::auto_ptr<Layout> create(const std::string& class_name, const params_t& params); |
| | | bool registed(const std::string& class_name) const; |
| | | |
| | | private: |
| | | LayoutsFactory(){}; |
| | | |
| | | typedef std::map<std::string, create_function_t> creators_t; |
| | | typedef creators_t::const_iterator const_iterator; |
| | | |
| | | creators_t creators_; |
| | | }; |
| | | } |
| | | |
| | | |
| | | #endif // h_409ac787_0acf_47ff_ac15_3e9024d40315 |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_3491ecd0_3891_4902_b3ba_15b15d98ae49) |
| | | #define h_3491ecd0_3891_4902_b3ba_15b15d98ae49 |
| | | |
| | | #include <log4cpp/TriggeringEventEvaluator.hh> |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class LOG4CPP_EXPORT LevelEvaluator : public TriggeringEventEvaluator |
| | | { |
| | | public: |
| | | LevelEvaluator(Priority::Value level) : level_(level) {} |
| | | virtual bool eval(const LoggingEvent& event) const { return event.priority <= level_; } |
| | | |
| | | private: |
| | | Priority::Value level_; |
| | | }; |
| | | } |
| | | |
| | | #endif // h_3491ecd0_3891_4902_b3ba_15b15d98ae49 |
New file |
| | |
| | | /* |
| | | * LoggingEvent.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_LOGGINGEVENT_HH |
| | | #define _LOG4CPP_LOGGINGEVENT_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | |
| | | #include <log4cpp/Priority.hh> |
| | | #include <log4cpp/TimeStamp.hh> |
| | | |
| | | /** |
| | | * The top level namespace for all 'Log for C++' types and classes. |
| | | **/ |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * The internal representation of logging events. When a affirmative |
| | | * logging decision is made a <code>LoggingEvent</code> instance is |
| | | * created. This instance is passed around the different log4cpp |
| | | * components. |
| | | * |
| | | * <p>This class is of concern to those wishing to extend log4cpp. |
| | | **/ |
| | | struct LOG4CPP_EXPORT LoggingEvent { |
| | | public: |
| | | /** |
| | | * Instantiate a LoggingEvent from the supplied parameters. |
| | | * |
| | | * <p>Except <code>timeStamp</code> all the other fields of |
| | | * <code>LoggingEvent</code> are filled when actually needed. |
| | | * <p> |
| | | * @param category The category of this event. |
| | | * @param message The message of this event. |
| | | * @param ndc The nested diagnostic context of this event. |
| | | * @param priority The priority of this event. |
| | | **/ |
| | | LoggingEvent(const std::string& category, const std::string& message, |
| | | const std::string& ndc, Priority::Value priority); |
| | | |
| | | |
| | | /** The category name. */ |
| | | const std::string categoryName; |
| | | |
| | | /** The application supplied message of logging event. */ |
| | | const std::string message; |
| | | |
| | | /** The nested diagnostic context (NDC) of logging event. */ |
| | | const std::string ndc; |
| | | |
| | | /** Priority of logging event. */ |
| | | Priority::Value priority; |
| | | |
| | | /** The name of thread in which this logging event was generated, |
| | | e.g. the PID. |
| | | */ |
| | | const std::string threadName; |
| | | |
| | | /** The number of seconds elapsed since the epoch |
| | | (1/1/1970 00:00:00 UTC) until logging event was created. */ |
| | | TimeStamp timeStamp; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_LOGGINGEVENT_HH |
| | | |
New file |
| | |
| | | SUBDIRS = threading |
| | | |
| | | liblog4cppincludedir = $(includedir)/log4cpp |
| | | liblog4cppinclude_HEADERS = \ |
| | | Appender.hh \ |
| | | AppenderSkeleton.hh \ |
| | | AppendersFactory.hh \ |
| | | BufferingAppender.hh \ |
| | | FactoryParams.hh \ |
| | | LayoutsFactory.hh \ |
| | | LevelEvaluator.hh \ |
| | | PassThroughLayout.hh \ |
| | | TriggeringEventEvaluator.hh \ |
| | | TriggeringEventEvaluatorFactory.hh \ |
| | | FixedContextCategory.hh \ |
| | | LayoutAppender.hh \ |
| | | FileAppender.hh \ |
| | | DailyRollingFileAppender.hh \ |
| | | RollingFileAppender.hh \ |
| | | IdsaAppender.hh \ |
| | | OstreamAppender.hh \ |
| | | StringQueueAppender.hh \ |
| | | SyslogAppender.hh \ |
| | | RemoteSyslogAppender.hh \ |
| | | Layout.hh \ |
| | | SimpleLayout.hh \ |
| | | BasicLayout.hh \ |
| | | PatternLayout.hh \ |
| | | Category.hh \ |
| | | CategoryStream.hh \ |
| | | HierarchyMaintainer.hh \ |
| | | Configurator.hh \ |
| | | BasicConfigurator.hh \ |
| | | SimpleConfigurator.hh \ |
| | | PropertyConfigurator.hh \ |
| | | LoggingEvent.hh \ |
| | | Priority.hh \ |
| | | NDC.hh \ |
| | | TimeStamp.hh \ |
| | | Filter.hh \ |
| | | Export.hh \ |
| | | Portability.hh \ |
| | | Win32DebugAppender.hh \ |
| | | NTEventLogAppender.hh \ |
| | | AbortAppender.hh \ |
| | | Manipulator.hh \ |
| | | config.h \ |
| | | config-win32.h \ |
| | | config-openvms.h \ |
| | | config-MinGW32.h \ |
| | | convenience.h |
| | | |
| | | dist-hook: |
| | | $(RM) -f $(distdir)/config.h |
| | | |
| | | distclean-local: |
| | | $(RM) config.h |
New file |
| | |
| | | /* |
| | | * Manipulator.hh |
| | | * |
| | | * Copyright 2005, Francis ANDRE. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_MANIPULATOR_HH |
| | | #define _LOG4CPP_MANIPULATOR_HH |
| | | |
| | | #include <iostream> |
| | | #include <log4cpp/Portability.hh> |
| | | namespace log4cpp { |
| | | class LOG4CPP_EXPORT width { |
| | | private: |
| | | unsigned int size; |
| | | public: |
| | | inline width(unsigned int i) : size(i) {} |
| | | friend LOG4CPP_EXPORT std::ostream& operator<< (std::ostream& os, const width& w); |
| | | }; |
| | | class LOG4CPP_EXPORT tab { |
| | | private: |
| | | unsigned int size; |
| | | public: |
| | | inline tab(unsigned int i) : size(i) {} |
| | | friend LOG4CPP_EXPORT std::ostream& operator<< (std::ostream& os, const tab& w); |
| | | }; |
| | | } |
| | | #endif |
New file |
| | |
| | | /* |
| | | * NDC.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_NDC_HH |
| | | #define _LOG4CPP_NDC_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <vector> |
| | | |
| | | namespace log4cpp { |
| | | /** |
| | | The NDC class implements <i>nested diagnostic contexts</i> as |
| | | defined by Neil Harrison in the article "Patterns for Logging |
| | | Diagnostic Messages" part of the book "<i>Pattern Languages of |
| | | Program Design 3</i>" edited by Martin et al. |
| | | |
| | | <p>A Nested Diagnostic Context, or NDC in short, is an instrument |
| | | to distinguish interleaved log output from different sources. Log |
| | | output is typically interleaved when a server handles multiple |
| | | clients near-simulatanously. |
| | | |
| | | <p>Interleaved log output can still be meaningful if each log entry |
| | | from different contexts had a distinctive stamp. This is where NDCs |
| | | come into play. |
| | | |
| | | <p><em><b>Note that NDCs are managed on a per thread |
| | | basis</b></em>. NDC operations such as <code>push</code>, <code> |
| | | pop</code>, <code>clear</code>, <code>getDepth</code> and <code> |
| | | setMaxDepth</code> affect the NDC of the <em>current</em> thread only. |
| | | NDCs of other threads remain unaffected. |
| | | |
| | | <p>To build an NDC one uses the <code>push</code> operation. |
| | | Simply put, |
| | | |
| | | <p><ul> |
| | | <li>Contexts can be nested. |
| | | |
| | | <p><li>When entering a context, call <code>NDC.push</code>. As a |
| | | side effect, if there is no nested diagnostic context for the |
| | | current thread, this method will create it. |
| | | |
| | | <p><li>When leaving a context, call <code>NDC.pop</code>. |
| | | </ul> |
| | | |
| | | <p>There is no penalty for forgetting to match each |
| | | <code>push</code> operation with a corresponding <code>pop</code>, |
| | | except the obvious mismatch between the real application context |
| | | and the context set in the NDC. |
| | | |
| | | <p>Custom Layouts may include the nested diagnostic context for the |
| | | current thread in log messages, without any user intervention. |
| | | Hence, even if a server is serving multiple clients |
| | | simultaneously, the logs emanating from the same code (belonging to |
| | | the same category) can still be distinguished because each client |
| | | request will have a different NDC tag. |
| | | |
| | | <p><em>Unfortunately, unlike Java, C++ does not have platform |
| | | independent multithreading support. Therefore, currently log4cpp is |
| | | not multithread aware, it implicitly assumes only one thread exists, |
| | | the main process thread. </em> |
| | | **/ |
| | | class LOG4CPP_EXPORT NDC { |
| | | /** |
| | | Whether NDC feature is ever used by the user. If it is not used then saves some time by skipping instructions |
| | | from: ver.1.1 |
| | | **/ |
| | | static bool isUsedNDC; |
| | | static const std::string emptyString; |
| | | public: |
| | | |
| | | struct DiagnosticContext { |
| | | DiagnosticContext(const std::string& message); |
| | | DiagnosticContext(const std::string& message, |
| | | const DiagnosticContext& parent); |
| | | |
| | | std::string message; |
| | | std::string fullMessage; |
| | | }; |
| | | |
| | | typedef std::vector<DiagnosticContext> ContextStack; |
| | | |
| | | /** |
| | | Clear any nested disgnostic information if any. This method is |
| | | useful in cases where the same thread can be potentially used |
| | | over and over in different unrelated contexts. |
| | | |
| | | <p>This method is equivalent to calling the <code>setMaxDepth</code> |
| | | method with a zero <code>maxDepth</code> argument. |
| | | **/ |
| | | static void clear(); |
| | | |
| | | /** |
| | | Clone the diagnostic context for the current thread. |
| | | |
| | | <p>Internally a diagnostic context is represented as a stack. A |
| | | given thread can supply the stack (i.e. diagnostic context) to a |
| | | child thread so that the child can inherit the parent thread's |
| | | diagnostic context. |
| | | |
| | | <p>The child thread uses the <code>inherit</code> method to |
| | | inherit the parent's diagnostic context. |
| | | |
| | | @return Stack A clone of the current thread's diagnostic context. |
| | | **/ |
| | | static ContextStack* cloneStack(); |
| | | |
| | | /** |
| | | Get the current diagnostic context string. |
| | | @return the context string. |
| | | **/ |
| | | static const std::string& get(); |
| | | |
| | | /** |
| | | Get the current nesting depth of this diagnostic context. |
| | | @return the nesting depth |
| | | **/ |
| | | static size_t getDepth(); |
| | | |
| | | static void inherit(ContextStack* stack); |
| | | |
| | | /** |
| | | Clients should call this method before leaving a diagnostic |
| | | context. |
| | | |
| | | <p>The returned value is the value that was pushed last. If no |
| | | context is available, then the empty string "" is returned. |
| | | |
| | | @return String The innermost diagnostic context. |
| | | **/ |
| | | |
| | | static std::string pop(); |
| | | |
| | | /** |
| | | Push new diagnostic context information for the current thread. |
| | | |
| | | <p>The contents of the <code>message</code> parameter is |
| | | determined solely by the client. |
| | | |
| | | @param message The new diagnostic context information. |
| | | **/ |
| | | static void push(const std::string& message); |
| | | |
| | | /** |
| | | Set the maximum nesting depth for the current NDC. Curently NDCs |
| | | do not enforce a maximum depth and consequentially this method |
| | | has no effect. |
| | | @param maxDepth the maximum nesting depth |
| | | **/ |
| | | static void setMaxDepth(int maxDepth); |
| | | |
| | | /** |
| | | Return the NDC for the current thread. |
| | | @return the NDC for the current thread |
| | | **/ |
| | | static NDC& getNDC(); |
| | | |
| | | NDC(); |
| | | virtual ~NDC(); |
| | | |
| | | public: |
| | | virtual void _clear(); |
| | | virtual ContextStack* _cloneStack(); |
| | | virtual const std::string& _get() const; |
| | | virtual size_t _getDepth() const; |
| | | virtual void _inherit(ContextStack* stack); |
| | | virtual std::string _pop(); |
| | | virtual void _push(const std::string& message); |
| | | virtual void _setMaxDepth(int maxDepth); |
| | | |
| | | ContextStack _stack; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_NDC_HH |
New file |
| | |
| | | /* |
| | | * NTEventLogAppender.hh |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_NTEVENTLOGAPPENDER_HH |
| | | #define _LOG4CPP_NTEVENTLOGAPPENDER_HH |
| | | |
| | | #ifdef WIN32 // only available on Win32 |
| | | |
| | | // deal with ERROR #define |
| | | // N.B. This #includes windows.h with NOGDI and WIN32_LEAN_AND_MEAN #defined. |
| | | // If this is not what the user wants, #include windows.h before this file. |
| | | #ifndef _WINDOWS_ |
| | | # ifndef NOGDI |
| | | # define NOGDI // this will circumvent the ERROR #define in windows.h |
| | | # define LOG4CPP_UNDEFINE_NOGDI |
| | | # endif |
| | | |
| | | # ifndef WIN32_LEAN_AND_MEAN |
| | | # define WIN32_LEAN_AND_MEAN |
| | | # define LOG4CPP_UNDEFINE_WIN32_LEAN_AND_MEAN |
| | | # endif |
| | | |
| | | # include <windows.h> |
| | | |
| | | # ifdef LOG4CPP_UNDEFINE_NOGDI |
| | | # undef NOGDI |
| | | # endif |
| | | |
| | | # ifdef LOG4CPP_UNDEFINE_WIN32_LEAN_AND_MEAN |
| | | # undef WIN32_LEAN_AND_MEAN |
| | | # endif |
| | | |
| | | #endif // done dealing with ERROR #define |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/AppenderSkeleton.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * NTEventLogAppender is an Appender that sends LoggingEvents to the |
| | | * Windows event log. |
| | | * Building log4cpp.dsp/log4cppDLL.dsp creates the resource DLL NTEventLogAppender.dll. |
| | | * Do not forget to place this DLL in a directory that is on the PATH |
| | | * of the Windows system. Otherwise, the category and message will not display |
| | | * correctly in Event Viewer.<BR> |
| | | * <B>NB:</B> This class is only available on Win32 platforms. |
| | | **/ |
| | | class LOG4CPP_EXPORT NTEventLogAppender : public AppenderSkeleton { |
| | | public: |
| | | |
| | | /** |
| | | * Instantiate an NTEventLogAppender with given name and source. |
| | | * @param name The name of the Appender |
| | | * @param sourceName The source name to log |
| | | **/ |
| | | NTEventLogAppender(const std::string& name, const std::string& sourceName); |
| | | virtual ~NTEventLogAppender(); |
| | | |
| | | /** |
| | | * Calls open() and close() |
| | | **/ |
| | | virtual bool reopen(); |
| | | |
| | | virtual void close(); |
| | | |
| | | /** |
| | | * The NTEventLogAppender does its own Layout. |
| | | * @returns false |
| | | **/ |
| | | virtual bool requiresLayout() const; |
| | | |
| | | virtual void setLayout(Layout* layout); |
| | | |
| | | protected: |
| | | |
| | | WORD getCategory(Priority::Value priority); |
| | | WORD getType(Priority::Value priority); |
| | | HKEY regGetKey(TCHAR *subkey, DWORD *disposition); |
| | | void regSetString(HKEY hkey, TCHAR *name, TCHAR *value); |
| | | void regSetDword(HKEY hkey, TCHAR *name, DWORD value); |
| | | void addRegistryInfo(const char *source); |
| | | |
| | | virtual void open(); |
| | | |
| | | /** |
| | | * Sends a LoggingEvent to NT Event log. |
| | | * @param event the LoggingEvent to log. |
| | | **/ |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | HANDLE _hEventSource; |
| | | std::string _strSourceName; |
| | | }; |
| | | } |
| | | |
| | | #else // WIN32 |
| | | #error NTEventLoggAppender is not available on on Win32 platforms |
| | | #endif // WIN32 |
| | | |
| | | #endif // _LOG4CPP_NTEVENTLOGAPPENDER_HH |
| | | |
New file |
| | |
| | | /* |
| | | * OstreamAppender.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_OSTREAMAPPENDER_HH |
| | | #define _LOG4CPP_OSTREAMAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <iostream> |
| | | #include <log4cpp/LayoutAppender.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * OstreamAppender appends LoggingEvents to ostreams. |
| | | **/ |
| | | class LOG4CPP_EXPORT OstreamAppender : public LayoutAppender { |
| | | public: |
| | | OstreamAppender(const std::string& name, std::ostream* stream); |
| | | virtual ~OstreamAppender(); |
| | | |
| | | virtual bool reopen(); |
| | | virtual void close(); |
| | | |
| | | protected: |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | std::ostream* _stream; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_OSTREAMAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_8e4861a3_f607_479c_ac2d_0b2d81b4c36c) |
| | | #define h_8e4861a3_f607_479c_ac2d_0b2d81b4c36c |
| | | |
| | | #include <log4cpp/Layout.hh> |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class PassThroughLayout : public Layout |
| | | { |
| | | public: |
| | | virtual std::string format(const LoggingEvent& event) { return event.message; } |
| | | }; |
| | | } |
| | | |
| | | #endif // h_8e4861a3_f607_479c_ac2d_0b2d81b4c36c |
New file |
| | |
| | | /* |
| | | * PatternLayout.hh |
| | | * |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_PATTERNLAYOUT_HH |
| | | #define _LOG4CPP_PATTERNLAYOUT_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Layout.hh> |
| | | #include <log4cpp/Configurator.hh> |
| | | #include <vector> |
| | | #ifdef LOG4CPP_HAVE_SSTREAM |
| | | #include <sstream> |
| | | #endif |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * PatternLayout is a simple fixed format Layout implementation. |
| | | **/ |
| | | class LOG4CPP_EXPORT PatternLayout : public Layout { |
| | | public: |
| | | /** |
| | | The default conversion pattern |
| | | **/ |
| | | static const char* DEFAULT_CONVERSION_PATTERN; |
| | | |
| | | /** |
| | | A conversion pattern equivalent to the SimpleLayout. |
| | | **/ |
| | | static const char* SIMPLE_CONVERSION_PATTERN; |
| | | |
| | | /** |
| | | A conversion pattern equivalent to the BasicLayout. |
| | | **/ |
| | | static const char* BASIC_CONVERSION_PATTERN; |
| | | |
| | | /** |
| | | A conversion pattern equivalent to the TTCCLayout. |
| | | Note: TTCCLayout is in log4j but not log4cpp. |
| | | **/ |
| | | static const char* TTCC_CONVERSION_PATTERN; |
| | | |
| | | PatternLayout(); |
| | | virtual ~PatternLayout(); |
| | | |
| | | // NOTE: All double percentage signs ('%%') followed by a character |
| | | // in the following comments should actually be a single char. |
| | | // The doubles are included so that doxygen will print them correctly. |
| | | /** |
| | | * Formats the LoggingEvent in the style set by |
| | | * the setConversionPattern call. By default, set |
| | | * to "%%m%%n" |
| | | **/ |
| | | virtual std::string format(const LoggingEvent& event); |
| | | |
| | | /** |
| | | * Sets the format of log lines handled by this |
| | | * PatternLayout. By default, set to "%%m%%n".<br> |
| | | * Format characters are as follows:<br> |
| | | * <li><b>%%</b> - a single percent sign</li> |
| | | * <li><b>%%c</b> - the category</li> |
| | | * <li><b>%%d</b> - the date\n |
| | | * Date format: The date format character may be followed by a date format |
| | | * specifier enclosed between braces. For example, %%d{%%H:%%M:%%S,%%l} or %%d{%%d %%m %%Y %%H:%%M:%%S,%%l}. |
| | | * If no date format specifier is given then the following format is used: |
| | | * "Wed Jan 02 02:03:55 1980". The date format specifier admits the same syntax |
| | | * as the ANSI C function strftime, with 1 addition. The addition is the specifier |
| | | * %%l for milliseconds, padded with zeros to make 3 digits.</li> |
| | | * <li><b>%%m</b> - the message</li> |
| | | * <li><b>%%n</b> - the platform specific line separator</li> |
| | | * <li><b>%%p</b> - the priority</li> |
| | | * <li><b>%%r</b> - milliseconds since this layout was created.</li> |
| | | * <li><b>%%R</b> - seconds since Jan 1, 1970</li> |
| | | * <li><b>%%u</b> - clock ticks since process start</li> |
| | | * <li><b>%%x</b> - the NDC</li> |
| | | * @param conversionPattern the conversion pattern |
| | | * @exception ConfigureFailure if the pattern is invalid |
| | | **/ |
| | | virtual void setConversionPattern(const std::string& conversionPattern); |
| | | |
| | | virtual std::string getConversionPattern() const; |
| | | |
| | | virtual void clearConversionPattern(); |
| | | |
| | | class LOG4CPP_EXPORT PatternComponent { |
| | | public: |
| | | inline virtual ~PatternComponent() {}; |
| | | virtual void append(std::ostringstream& out, const LoggingEvent& event) = 0; |
| | | }; |
| | | |
| | | private: |
| | | typedef std::vector<PatternComponent*> ComponentVector; |
| | | ComponentVector _components; |
| | | |
| | | std::string _conversionPattern; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_PATTERNLAYOUT_HH |
New file |
| | |
| | | /* |
| | | * Portability.hh |
| | | * |
| | | * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2001, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_PORTABILITY_HH |
| | | #define _LOG4CPP_PORTABILITY_HH |
| | | |
| | | #if defined (_MSC_VER) || defined(__BORLANDC__) |
| | | # if defined (LOG4CPP_STLPORT_AND_BOOST_BUILD) |
| | | # include <log4cpp/config-win32-stlport-boost.h> |
| | | # else |
| | | # include <log4cpp/config-win32.h> |
| | | # endif |
| | | |
| | | #ifdef MSVC_MEMORY_LEAK_CHECK |
| | | #define _CRTDBG_MAP_ALLOC |
| | | |
| | | #include <stdlib.h> |
| | | #include <crtdbg.h> |
| | | |
| | | #ifdef _DEBUG |
| | | #ifndef DBG_NEW |
| | | #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) |
| | | #define new DBG_NEW |
| | | #endif |
| | | #endif // _DEBUG |
| | | #endif // MSVC_MEMORY_LEAK_CHECK |
| | | |
| | | #else |
| | | #if defined(__OPENVMS__) |
| | | # include <log4cpp/config-openvms.h> |
| | | #else |
| | | # if defined(__MINGW32__) |
| | | # include <log4cpp/config-MinGW32.h> |
| | | # else |
| | | # include <log4cpp/config.h> |
| | | # endif |
| | | #endif |
| | | #endif |
| | | |
| | | #include <log4cpp/Export.hh> |
| | | |
| | | #if defined(_MSC_VER) |
| | | # pragma warning( disable : 4786 ) // 255 char debug symbol limit |
| | | # pragma warning( disable : 4290 ) // throw specifier not implemented |
| | | # pragma warning( disable : 4251 ) // "class XXX should be exported" |
| | | #endif |
| | | |
| | | #ifdef __APPLE__ |
| | | # include <sstream> |
| | | #else |
| | | # ifndef LOG4CPP_HAVE_SSTREAM |
| | | # include <strstream> |
| | | namespace std { |
| | | class LOG4CPP_EXPORT ostringstream : public ostrstream { |
| | | public: |
| | | std::string str(); |
| | | }; |
| | | }; |
| | | # endif // LOG4CPP_HAVE_SSTREAM |
| | | #endif // _APPLE_ |
| | | |
| | | |
| | | #endif |
New file |
| | |
| | | /* |
| | | * Priority.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_PRIORITY_HH |
| | | #define _LOG4CPP_PRIORITY_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <stdexcept> |
| | | |
| | | /* |
| | | * Optionally work around rudeness in windows.h on Win32. |
| | | */ |
| | | #ifdef ERROR |
| | | #ifdef LOG4CPP_FIX_ERROR_COLLISION |
| | | |
| | | namespace log4cpp { |
| | | static const int _tmpERRORValue = ERROR; |
| | | } |
| | | |
| | | #undef ERROR |
| | | static const int ERROR = log4cpp::_tmpERRORValue; |
| | | #define ERROR ERROR |
| | | |
| | | #else // LOG4CPP_FIX_ERROR_COLLISION |
| | | #error Naming collision for 'ERROR' detected. Please read the FAQ for a \ |
| | | workaround. |
| | | #endif // LOG4CPP_FIX_ERROR_COLLISION |
| | | |
| | | #endif // ERROR |
| | | |
| | | /* |
| | | * Other Win32 rudeness in EDK.h |
| | | */ |
| | | #ifdef DEBUG |
| | | |
| | | #ifdef LOG4CPP_FIX_ERROR_COLLISION |
| | | |
| | | #undef DEBUG |
| | | #define DEBUG DEBUG |
| | | |
| | | #else // LOG4CPP_FIX_ERROR_COLLISION |
| | | #error Naming collision for 'DEBUG' detected. Please read the FAQ for a \ |
| | | workaround. |
| | | #endif // LOG4CPP_FIX_ERROR_COLLISION |
| | | |
| | | #endif // DEBUG |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * The Priority class provides importance levels with which one |
| | | * can categorize log messages. |
| | | **/ |
| | | class LOG4CPP_EXPORT Priority { |
| | | public: |
| | | |
| | | static const int MESSAGE_SIZE; // = 8; |
| | | |
| | | /** |
| | | * Predefined Levels of Priorities. These correspond to the |
| | | * priority levels used by syslog(3). |
| | | **/ |
| | | typedef enum {EMERG = 0, |
| | | FATAL = 0, |
| | | ALERT = 100, |
| | | CRIT = 200, |
| | | ERROR = 300, |
| | | WARN = 400, |
| | | NOTICE = 500, |
| | | INFO = 600, |
| | | DEBUG = 700, |
| | | NOTSET = 800 |
| | | } PriorityLevel; |
| | | |
| | | /** |
| | | * The type of Priority Values |
| | | **/ |
| | | typedef int Value; |
| | | |
| | | /** |
| | | * Returns the name of the given priority value. |
| | | * Currently, if the value is not one of the PriorityLevel values, |
| | | * the method returns the name of the largest priority smaller |
| | | * the given value. |
| | | * @param priority the numeric value of the priority. |
| | | * @returns a string representing the name of the priority. |
| | | **/ |
| | | static const std::string& getPriorityName(int priority) throw(); |
| | | |
| | | /** |
| | | * Returns the value of the given priority name. |
| | | * This can be either one of EMERG ... NOTSET or a |
| | | * decimal string representation of the value, e.g. '700' for DEBUG. |
| | | * @param priorityName the string containing the the of the priority |
| | | * @return the value corresponding with the priority name |
| | | * @throw std::invalid_argument if the priorityName does not |
| | | * correspond with a known Priority name or a number |
| | | **/ |
| | | static Value getPriorityValue(const std::string& priorityName); |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_PRIORITY_HH |
New file |
| | |
| | | /* |
| | | * SimpleConfigurator.hh |
| | | * |
| | | * Copyright 2001, Glen Scott. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | #ifndef _LOG4CPP_PROPERTYCONFIGURATOR_HH |
| | | #define _LOG4CPP_PROPERTYCONFIGURATOR_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Export.hh> |
| | | |
| | | #include <string> |
| | | #include <log4cpp/Configurator.hh> // configure exceptions |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | Property configurator will read a config file using the same (or similar) |
| | | format to the config file used by log4j. This file is in a standard Java |
| | | "properties" file format. |
| | | <P>Example:<BR> |
| | | <PRE> |
| | | # a simple test config |
| | | |
| | | log4j.rootCategory=DEBUG, rootAppender |
| | | log4j.category.sub1=A1 |
| | | log4j.category.sub2=INFO |
| | | log4j.category.sub1.sub2=ERROR, A2 |
| | | |
| | | log4j.appender.rootAppender=org.apache.log4j.ConsoleAppender |
| | | log4j.appender.rootAppender.layout=org.apache.log4j.BasicLayout |
| | | |
| | | log4j.appender.A1=org.apache.log4j.FileAppender |
| | | log4j.appender.A1.fileName=A1.log |
| | | log4j.appender.A1.layout=org.apache.log4j.BasicLayout |
| | | |
| | | log4j.appender.A2=org.apache.log4j.ConsoleAppender |
| | | log4j.appender.A2.layout=org.apache.log4j.PatternLayout |
| | | log4j.appender.A2.layout.ConversionPattern=The message %%m at time %%d%%n |
| | | </PRE> |
| | | |
| | | @since 0.3.2 |
| | | **/ |
| | | class LOG4CPP_EXPORT PropertyConfigurator { |
| | | public: |
| | | /** |
| | | * |
| | | * @param initFileName |
| | | * @exception ConfigureFailure if the method encountered a read or |
| | | * syntax error. |
| | | */ |
| | | static void configure(const std::string& initFileName); |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_PROPERTYCONFIGURATOR_HH |
New file |
| | |
| | | /* |
| | | * SyslogAppender.hh |
| | | * |
| | | * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2001, Walter Stroebel. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_REMOTESYSLOGAPPENDER_HH |
| | | #define _LOG4CPP_REMOTESYSLOGAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <stdarg.h> |
| | | #include <log4cpp/LayoutAppender.hh> |
| | | #include <log4cpp/Priority.hh> |
| | | #ifdef WIN32 |
| | | #include <winsock2.h> |
| | | #else |
| | | #include <netinet/in.h> |
| | | #endif |
| | | |
| | | #ifdef LOG4CPP_HAVE_SYSLOG |
| | | #include <syslog.h> |
| | | #else |
| | | /// from syslog.h |
| | | typedef enum { |
| | | LOG_EMERG = 0, ///< system is unusable |
| | | LOG_ALERT = 1, ///< action must be taken immediately |
| | | LOG_CRIT = 2, ///< critical conditions |
| | | LOG_ERR = 3, ///< error conditions |
| | | LOG_WARNING = 4, ///< warning conditions |
| | | LOG_NOTICE = 5, ///< normal but significant condition |
| | | LOG_INFO = 6, ///< informational |
| | | LOG_DEBUG = 7, ///< debug-level messages |
| | | } SyslogLevel; |
| | | |
| | | typedef enum { |
| | | LOG_KERN = (0<<3), ///< kernel messages |
| | | LOG_USER = (1<<3), ///< random user-level messages |
| | | LOG_MAIL = (2<<3), ///< mail system |
| | | LOG_DAEMON = (3<<3), ///< system daemons |
| | | LOG_AUTH = (4<<3), ///< security/authorization messages |
| | | LOG_SYSLOG = (5<<3), ///< messages generated internally by syslogd |
| | | LOG_LPR = (6<<3), ///< line printer subsystem |
| | | LOG_NEWS = (7<<3), ///< network news subsystem |
| | | LOG_UUCP = (8<<3), ///< UUCP subsystem |
| | | LOG_CRON = (9<<3), ///< clock daemon |
| | | LOG_AUTHPRIV = (10<<3), ///< security/authorization messages (private) |
| | | LOG_FTP = (11<<3), ///< ftp daemon |
| | | |
| | | /* other codes through 15 reserved for system use */ |
| | | LOG_LOCAL0 = (16<<3), ///< reserved for local use |
| | | LOG_LOCAL1 = (17<<3), ///< reserved for local use |
| | | LOG_LOCAL2 = (18<<3), ///< reserved for local use |
| | | LOG_LOCAL3 = (19<<3), ///< reserved for local use |
| | | LOG_LOCAL4 = (20<<3), ///< reserved for local use |
| | | LOG_LOCAL5 = (21<<3), ///< reserved for local use |
| | | LOG_LOCAL6 = (22<<3), ///< reserved for local use |
| | | LOG_LOCAL7 = (23<<3), ///< reserved for local use |
| | | } SyslogFacility; |
| | | #endif |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * RemoteSyslogAppender sends LoggingEvents to a remote syslog system. |
| | | * |
| | | * Also see: draft-ietf-syslog-syslog-12.txt |
| | | **/ |
| | | class LOG4CPP_EXPORT RemoteSyslogAppender : public LayoutAppender { |
| | | public: |
| | | |
| | | /** |
| | | * Translates a log4cpp priority to a syslog priority |
| | | * @param priority The log4cpp priority. |
| | | * @returns the syslog priority. |
| | | **/ |
| | | static int toSyslogPriority(Priority::Value priority); |
| | | |
| | | /** |
| | | * Instantiate a RemoteSyslogAppender with given name and name and |
| | | * facility for syslog. |
| | | * @param name The name of the Appender |
| | | * @param syslogName The ident parameter in the openlog(3) call. |
| | | * @param relayer The IP address or hostname of a standard syslog host. |
| | | * @param facility The syslog facility to log to. Defaults to LOG_USER. |
| | | * Value '-1' implies to use the default. |
| | | * @param portNumber An alternative port number. Defaults to the |
| | | * standard syslog port number (514). |
| | | * Value '-1' implies to use the default. |
| | | **/ |
| | | RemoteSyslogAppender(const std::string& name, |
| | | const std::string& syslogName, |
| | | const std::string& relayer, |
| | | int facility = LOG_USER, |
| | | int portNumber = 514); |
| | | virtual ~RemoteSyslogAppender(); |
| | | |
| | | /** |
| | | * Closes and reopens the socket. |
| | | **/ |
| | | virtual bool reopen(); |
| | | |
| | | /** |
| | | * Closes the socket |
| | | **/ |
| | | virtual void close(); |
| | | |
| | | protected: |
| | | |
| | | /** |
| | | * Just creates the socket. |
| | | **/ |
| | | virtual void open(); |
| | | |
| | | /** |
| | | * Sends a LoggingEvent to the remote syslog. |
| | | * @param event the LoggingEvent to log. |
| | | **/ |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | const std::string _syslogName; |
| | | const std::string _relayer; |
| | | int _facility; |
| | | int _portNumber; |
| | | #ifdef WIN32 |
| | | SOCKET _socket; |
| | | #else |
| | | int _socket; |
| | | #endif |
| | | in_addr_t _ipAddr; |
| | | private: |
| | | int _cludge; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_REMOTESYSLOGAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * RollingFileAppender.hh |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_ROLLINGFILEAPPENDER_HH |
| | | #define _LOG4CPP_ROLLINGFILEAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/FileAppender.hh> |
| | | #include <string> |
| | | #include <stdarg.h> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | RollingFileAppender is a FileAppender that rolls over the logfile once |
| | | it has reached a certain size limit. |
| | | @since 0.3.1 |
| | | **/ |
| | | class LOG4CPP_EXPORT RollingFileAppender : public FileAppender { |
| | | public: |
| | | RollingFileAppender(const std::string& name, |
| | | const std::string& fileName, |
| | | size_t maxFileSize = 10*1024*1024, |
| | | unsigned int maxBackupIndex = 1, |
| | | bool append = true, |
| | | mode_t mode = 00644); |
| | | |
| | | virtual void setMaxBackupIndex(unsigned int maxBackups); |
| | | virtual unsigned int getMaxBackupIndex() const; |
| | | virtual void setMaximumFileSize(size_t maxFileSize); |
| | | virtual size_t getMaxFileSize() const; |
| | | |
| | | virtual void rollOver(); |
| | | |
| | | protected: |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | unsigned int _maxBackupIndex; |
| | | unsigned short int _maxBackupIndexWidth; // keep constant index width by zeroing leading positions |
| | | |
| | | size_t _maxFileSize; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_ROLLINGFILEAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * SimpleConfigurator.hh |
| | | * |
| | | * Copyright 2001, Glen Scott. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | #ifndef _LOG4CPP_SIMPLECONFIGURATOR_HH |
| | | #define _LOG4CPP_SIMPLECONFIGURATOR_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <iostream> |
| | | #include <string> |
| | | #include <log4cpp/Configurator.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * This class implements a simple Configurator for log4cpp. |
| | | * It is a temporary hack with an undocumented configuration format. |
| | | * @deprecated As of version 0.3.2 log4cpp includes a log4j format |
| | | * compatible PropertyConfigurator, removing the need for |
| | | * SimpleConfigurator. This class will be removed in 0.4.0. |
| | | **/ |
| | | class LOG4CPP_EXPORT SimpleConfigurator { |
| | | public: |
| | | |
| | | /** |
| | | * Configure log4cpp with the configuration in the given file. |
| | | * NB. The configuration file format is undocumented and may change |
| | | * without notice. |
| | | * @since 0.2.6 |
| | | * @param initFileName name of the configuration file |
| | | * @exception ConfigureFailure if the method encountered a read or |
| | | * syntax error. |
| | | **/ |
| | | static void configure(const std::string& initFileName); |
| | | |
| | | /** |
| | | * Configure log4cpp with the configuration in the given file. |
| | | * NB. The configuration file format is undocumented and may change |
| | | * without notice. |
| | | * @since 0.3.1 |
| | | * @param initFile an input stream to the configuration file |
| | | * @exception ConfigureFailure if the method encountered a read or |
| | | * syntax error. |
| | | **/ |
| | | static void configure(std::istream& initFile); |
| | | }; |
| | | } |
| | | |
| | | #endif |
New file |
| | |
| | | /* |
| | | * SimpleLayout.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_SIMPLELAYOUT_HH |
| | | #define _LOG4CPP_SIMPLELAYOUT_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <log4cpp/Layout.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * BasicLayout is a simple fixed format Layout implementation. |
| | | **/ |
| | | class LOG4CPP_EXPORT SimpleLayout : public Layout { |
| | | public: |
| | | SimpleLayout(); |
| | | virtual ~SimpleLayout(); |
| | | |
| | | /** |
| | | * Formats the LoggingEvent in SimpleLayout style:<br> |
| | | * "priority - message" |
| | | **/ |
| | | virtual std::string format(const LoggingEvent& event); |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_SIMPLELAYOUT_HH |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_2c5af17f_8daf_418f_acb8_5cfce724ec1a) |
| | | #define h_2c5af17f_8daf_418f_acb8_5cfce724ec1a |
| | | |
| | | #if defined(LOG4CPP_HAVE_BOOST) |
| | | #include <boost/version.hpp> |
| | | #if BOOST_VERSION > 103400 |
| | | |
| | | #include "Portability.hh" |
| | | #include "LayoutAppender.hh" |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class LOG4CPP_EXPORT SmptAppender : public LayoutAppender |
| | | { |
| | | public: |
| | | struct mail_params; |
| | | |
| | | SmptAppender(const std::string& name, const std::string& host, const std::string& from, |
| | | const std::string& to, const std::string& subject); |
| | | virtual ~SmptAppender(); |
| | | virtual void close() { } |
| | | |
| | | protected: |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | private: |
| | | mail_params * mail_params_; |
| | | }; |
| | | } |
| | | |
| | | #endif // BOOST_VERSION >= 103400 |
| | | #endif // LOG4CPP_HAS_BOOST |
| | | #endif // h_2c5af17f_8daf_418f_acb8_5cfce724ec1a |
New file |
| | |
| | | /* |
| | | * StringQueueAppender.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_STRINGQUEUEAPPENDER_HH |
| | | #define _LOG4CPP_STRINGQUEUEAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <queue> |
| | | #include <log4cpp/LayoutAppender.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * This class puts log messages in an in-memory queue. Its primary use |
| | | * is in test cases, but it may be useful elsewhere as well. |
| | | * |
| | | * @since 0.2.4 |
| | | **/ |
| | | class LOG4CPP_EXPORT StringQueueAppender : public LayoutAppender { |
| | | public: |
| | | |
| | | StringQueueAppender(const std::string& name); |
| | | virtual ~StringQueueAppender(); |
| | | |
| | | virtual bool reopen(); |
| | | virtual void close(); |
| | | |
| | | /** |
| | | * Return the current size of the message queue. |
| | | * Shorthand for getQueue().size(). |
| | | * @returns the queue size |
| | | **/ |
| | | virtual size_t queueSize() const; |
| | | |
| | | /** |
| | | * Return the queue to which the Appends adds messages. |
| | | * @returns the message queue |
| | | **/ |
| | | virtual std::queue<std::string>& getQueue(); |
| | | |
| | | /** |
| | | * Return the queue to which the Appends adds messages. |
| | | * @returns the message queue |
| | | **/ |
| | | virtual const std::queue<std::string>& getQueue() const; |
| | | |
| | | /** |
| | | * Pop the oldest log message from the front of the queue. |
| | | * @returns the oldest log message |
| | | **/ |
| | | virtual std::string popMessage(); |
| | | |
| | | protected: |
| | | |
| | | /** |
| | | * Appends the LoggingEvent to the queue. |
| | | * @param event the LoggingEvent to layout and append to the queue. |
| | | **/ |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | std::queue<std::string> _queue; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_STRINGQUEUEAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * SyslogAppender.hh |
| | | * |
| | | * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2000, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_SYSLOGAPPENDER_HH |
| | | #define _LOG4CPP_SYSLOGAPPENDER_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <string> |
| | | #include <stdarg.h> |
| | | #include <syslog.h> |
| | | #include <log4cpp/LayoutAppender.hh> |
| | | #include <log4cpp/Priority.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * SyslogAppender sends LoggingEvents to the local syslog system. |
| | | **/ |
| | | class SyslogAppender : public LayoutAppender { |
| | | public: |
| | | |
| | | /** |
| | | * Translates a log4cpp priority to a syslog priority |
| | | * @param priority The log4cpp priority. |
| | | * @returns the syslog priority. |
| | | **/ |
| | | static int toSyslogPriority(Priority::Value priority); |
| | | |
| | | /** |
| | | * Instantiate a SyslogAppender with given name and name and facility |
| | | * for syslog. Note that the C syslog API is process global, so |
| | | * instantion of a second SyslogAppender will 'overwrite' the |
| | | * syslog name of the first. |
| | | * @param name The name of the Appender |
| | | * @param syslogName The ident parameter in the openlog(3) call. |
| | | * @param facility The syslog facility to log to. Defaults to LOG_USER. |
| | | **/ |
| | | SyslogAppender(const std::string& name, const std::string& syslogName, |
| | | int facility = LOG_USER); |
| | | virtual ~SyslogAppender(); |
| | | |
| | | /** |
| | | * Calls closelog(3) and openlog(3). |
| | | **/ |
| | | virtual bool reopen(); |
| | | |
| | | /** |
| | | * Calls closelog(3) to close the syslog file descriptor. |
| | | **/ |
| | | virtual void close(); |
| | | |
| | | protected: |
| | | |
| | | /** |
| | | * Calls openlog(3). |
| | | **/ |
| | | virtual void open(); |
| | | |
| | | /** |
| | | * Sends a LoggingEvent to syslog. |
| | | * @param event the LoggingEvent to log. |
| | | **/ |
| | | virtual void _append(const LoggingEvent& event); |
| | | |
| | | const std::string _syslogName; |
| | | int _facility; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_SYSLOGAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * TimeStamp.hh |
| | | * |
| | | * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2001, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_TIMESTAMP_HH |
| | | #define _LOG4CPP_TIMESTAMP_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * A simple TimeStamp abstraction |
| | | **/ |
| | | class LOG4CPP_EXPORT TimeStamp { |
| | | public: |
| | | /** |
| | | Constructs a TimeStamp representing 'now'. |
| | | **/ |
| | | TimeStamp(); |
| | | |
| | | /** |
| | | Constructs a TimeStamp representing the given offset since the |
| | | epoch ( 00:00:00 1970/1/1 UTC). |
| | | **/ |
| | | TimeStamp(unsigned int seconds, unsigned int microSeconds = 0); |
| | | |
| | | /** |
| | | Returns the 'seconds' part of the TimeStamp. |
| | | **/ |
| | | inline int getSeconds() const { |
| | | return _seconds; |
| | | }; |
| | | |
| | | /** |
| | | Returns the 'subseconds' part of the TimeStamp in milliseconds, |
| | | getMilliSeconds() == getMicroSeconds() / 1000. |
| | | **/ |
| | | inline int getMilliSeconds() const { |
| | | return _microSeconds / 1000; |
| | | }; |
| | | |
| | | /** |
| | | Returns the subsecond part of the TimeStamp in microseconds. |
| | | The actual precision of this value depends on the platform and |
| | | may be in the order of milliseconds rather than microseconds. |
| | | **/ |
| | | inline int getMicroSeconds() const { |
| | | return _microSeconds; |
| | | }; |
| | | |
| | | /** |
| | | Returns a TimeStamp representing the time at which the application |
| | | started. |
| | | **/ |
| | | static inline const TimeStamp& getStartTime() { |
| | | return _startStamp; |
| | | }; |
| | | |
| | | protected: |
| | | static TimeStamp _startStamp; |
| | | |
| | | int _seconds; |
| | | int _microSeconds; |
| | | }; |
| | | } |
| | | |
| | | #endif // _LOG4CPP_TIMESTAMP_HH |
| | | |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_fb88639f_85c9_481a_a3a0_f25ae8bac24c) |
| | | #define h_fb88639f_85c9_481a_a3a0_f25ae8bac24c |
| | | |
| | | #include <log4cpp/LoggingEvent.hh> |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class LOG4CPP_EXPORT TriggeringEventEvaluator |
| | | { |
| | | public: |
| | | virtual bool eval(const LoggingEvent& event) const = 0; |
| | | virtual ~TriggeringEventEvaluator() {} |
| | | }; |
| | | } |
| | | |
| | | #endif // h_fb88639f_85c9_481a_a3a0_f25ae8bac24c |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #if !defined(h_dd233b8b_5c59_4956_9393_6581c95f9779) |
| | | #define h_dd233b8b_5c59_4956_9393_6581c95f9779 |
| | | |
| | | #include <string> |
| | | #include <map> |
| | | #include <memory> |
| | | #include "Portability.hh" |
| | | #include "TriggeringEventEvaluator.hh" |
| | | #include "FactoryParams.hh" |
| | | |
| | | namespace log4cpp |
| | | { |
| | | class LOG4CPP_EXPORT TriggeringEventEvaluatorFactory |
| | | { |
| | | public: |
| | | typedef FactoryParams params_t; |
| | | typedef std::auto_ptr<TriggeringEventEvaluator> (*create_function_t)(const params_t& params); |
| | | |
| | | static TriggeringEventEvaluatorFactory& getInstance(); |
| | | void registerCreator(const std::string& class_name, create_function_t create_function); |
| | | std::auto_ptr<TriggeringEventEvaluator> create(const std::string& class_name, const params_t& params); |
| | | bool registered(const std::string& class_name) const; |
| | | |
| | | private: |
| | | TriggeringEventEvaluatorFactory(){}; |
| | | |
| | | typedef std::map<std::string, create_function_t> creators_t; |
| | | typedef creators_t::const_iterator const_iterator; |
| | | |
| | | creators_t creators_; |
| | | }; |
| | | } |
| | | |
| | | #endif // h_dd233b8b_5c59_4956_9393_6581c95f9779 |
New file |
| | |
| | | /* |
| | | * Win32DebugAppender.hh |
| | | * |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_WIN32DEBUGAPPENDER_HH |
| | | #define _LOG4CPP_WIN32DEBUGAPPENDER_HH |
| | | |
| | | #ifdef WIN32 // only use this on Win32 |
| | | |
| | | #include <string> |
| | | #include "log4cpp/Export.hh" |
| | | #include "log4cpp/LayoutAppender.hh" |
| | | |
| | | namespace log4cpp { |
| | | |
| | | /** |
| | | * Win32DebugAppender simply sends the log message to the default system |
| | | * debugger on Win32 systems. This is useful for users of MSVC and Borland |
| | | * because the log messages will show up in the debugger window.<BR> |
| | | * <B>NB:</B> This class is only available on Win32 platforms. |
| | | */ |
| | | class LOG4CPP_EXPORT Win32DebugAppender : public LayoutAppender { |
| | | public: |
| | | /** |
| | | * Constructor. |
| | | * @param name Name used by the base classes only. |
| | | */ |
| | | Win32DebugAppender(const std::string& name); |
| | | /** |
| | | * Destructor. |
| | | */ |
| | | virtual ~Win32DebugAppender(); |
| | | |
| | | /** |
| | | * Close method. This is called by the framework, but there is nothing |
| | | * to do for the OutputDebugString API, so it simply returns. |
| | | */ |
| | | virtual void close(); |
| | | |
| | | protected: |
| | | /** |
| | | * Method that does the actual work. In this case, it simply sets up the layout |
| | | * and calls the OutputDebugString API. |
| | | * @param event Event for which we are logging. |
| | | */ |
| | | virtual void _append(const LoggingEvent& event); |
| | | }; |
| | | } |
| | | |
| | | #else // WIN32 |
| | | #error NTEventLoggAppender is not available on on Win32 platforms |
| | | #endif // WIN32 |
| | | |
| | | #endif // _LOG4CPP_WIN32DEBUGAPPENDER_HH |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _INCLUDE_LOG4CPP_CONFIG_MINGW32_H |
| | | #define _INCLUDE_LOG4CPP_CONFIG_MINGW32_H 1 |
| | | |
| | | /* manually edited from include/log4cpp/config.h */ |
| | | |
| | | /* Define if you have the syslog function. */ |
| | | /* #undef LOG4CPP_HAVE_SYSLOG */ |
| | | |
| | | /* Define if you have the `ftime' function. */ |
| | | #ifndef LOG4CPP_HAVE_FTIME |
| | | #define LOG4CPP_HAVE_FTIME 1 |
| | | #endif |
| | | |
| | | /* Define if you have the `gettimeofday' function. */ |
| | | /* #undef LOG4CPP_HAVE_GETTIMEOFDAY */ |
| | | |
| | | /* define if the compiler has int64_t */ |
| | | #ifndef LOG4CPP_HAVE_INT64_T |
| | | #define LOG4CPP_HAVE_INT64_T |
| | | #define int64_t __int64 |
| | | |
| | | /* define if the compiler has in_addr_t */ |
| | | #ifndef LOG4CPP_HAVE_IN_ADDR_T |
| | | #define LOG4CPP_HAVE_IN_ADDR_T |
| | | |
| | | #ifndef u_long |
| | | typedef unsigned long u_long; |
| | | #endif |
| | | |
| | | /* u_long is the type of in_addr.s_addr */ |
| | | typedef u_long in_addr_t; |
| | | |
| | | /* u_short is the type of sockaddr_in.sin_port */ |
| | | // typedef u_short in_port_t; |
| | | |
| | | #endif |
| | | |
| | | #endif |
| | | |
| | | /* Define if you have the <io.h> header file. */ |
| | | #ifndef LOG4CPP_HAVE_IO_H |
| | | #define LOG4CPP_HAVE_IO_H 1 |
| | | #endif |
| | | |
| | | /* Define if you have the <unistd.h> header file. */ |
| | | /* #undef LOG4CPP_HAVE_UNISTD_H */ |
| | | |
| | | /* Define if you have the idsa library (-lidsa). */ |
| | | /* #undef LOG4CPP_HAVE_LIBIDSA */ |
| | | |
| | | /* Define if you have the `strcasecmp' function. */ |
| | | /* #undef LOG4CPP_HAVE_STRCASECMP */ |
| | | |
| | | /* Name of package */ |
| | | #ifndef LOG4CPP_PACKAGE |
| | | #define LOG4CPP_PACKAGE "log4cpp" |
| | | #endif |
| | | |
| | | /* Version number of package */ |
| | | #ifndef LOG4CPP_VERSION |
| | | #define LOG4CPP_VERSION "1.0" |
| | | #endif |
| | | |
| | | /* define if the compiler implements namespaces */ |
| | | #ifndef LOG4CPP_HAVE_NAMESPACES |
| | | #define LOG4CPP_HAVE_NAMESPACES 1 |
| | | #endif |
| | | |
| | | /* define if the compiler has stringstream */ |
| | | #ifndef LOG4CPP_HAVE_SSTREAM |
| | | #define LOG4CPP_HAVE_SSTREAM 1 |
| | | #endif |
| | | |
| | | #define LOG4CPP_HAS_WCHAR_T 0 |
| | | |
| | | /* define if the C library has snprintf */ |
| | | #ifndef LOG4CPP_HAVE_SNPRINTF |
| | | #define LOG4CPP_HAVE_SNPRINTF 1 |
| | | #endif |
| | | |
| | | //#define LOG4CPP_HAVE_LOCALTIME_R 0 |
| | | |
| | | /* define to get around problems with ERROR in windows.h */ |
| | | #ifndef LOG4CPP_FIX_ERROR_COLLISION |
| | | #define LOG4CPP_FIX_ERROR_COLLISION 1 |
| | | #endif |
| | | |
| | | /* use threads */ |
| | | #ifndef LOG4CPP_HAVE_THREADING |
| | | #define LOG4CPP_HAVE_THREADING |
| | | # if defined(LOG4CPP_STLPORT_AND_BOOST_BUILD) |
| | | # define LOG4CPP_USE_BOOSTTHREADS |
| | | # else |
| | | # define LOG4CPP_USE_MSTHREADS |
| | | # endif |
| | | #endif |
| | | |
| | | #endif |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _INCLUDE_LOG4CPP_CONFIG_OPENVMS_H |
| | | #define _INCLUDE_LOG4CPP_CONFIG_OPENVMS_H 1 |
| | | |
| | | /* include/log4cpp/config.h. Generated automatically at end of configure. */ |
| | | /* include/config.h. Generated automatically by configure. */ |
| | | /* include/config.h.in. Generated automatically from configure.in by autoheader. */ |
| | | |
| | | /* Define if you have the <dlfcn.h> header file. */ |
| | | #ifndef LOG4CPP_HAVE_DLFCN_H |
| | | #define LOG4CPP_HAVE_DLFCN_H 1 |
| | | #endif |
| | | |
| | | /* Define if you have the `ftime' function. */ |
| | | #ifndef LOG4CPP_HAVE_FTIME |
| | | #define LOG4CPP_HAVE_FTIME 1 |
| | | #endif |
| | | |
| | | /* Define if you have the `gettimeofday' function. */ |
| | | #ifndef LOG4CPP_HAVE_GETTIMEOFDAY |
| | | #define LOG4CPP_HAVE_GETTIMEOFDAY 1 |
| | | #endif |
| | | |
| | | /* define if the compiler has int64_t */ |
| | | #ifndef LOG4CPP_HAVE_INT64_T |
| | | #define LOG4CPP_HAVE_INT64_T |
| | | #include <inttypes.h> |
| | | #endif |
| | | |
| | | /* Define if you have the <io.h> header file. */ |
| | | /* #undef LOG4CPP_HAVE_IO_H */ |
| | | |
| | | /* Define if you have the `idsa' library (-lidsa). */ |
| | | /* #undef LOG4CPP_HAVE_LIBIDSA */ |
| | | |
| | | /* define if the compiler implements namespaces */ |
| | | #ifndef LOG4CPP_HAVE_NAMESPACES |
| | | #define LOG4CPP_HAVE_NAMESPACES |
| | | #endif |
| | | |
| | | /* define if the C library has snprintf */ |
| | | /* #undef LOG4CPP_HAVE_SNPRINTF */ |
| | | |
| | | /* define if the compiler has stringstream */ |
| | | #ifndef LOG4CPP_HAVE_SSTREAM |
| | | #define LOG4CPP_HAVE_SSTREAM |
| | | #endif |
| | | |
| | | /* Define if you have the `syslog' function. */ |
| | | /* #undef LOG4CPP_HAVE_SYSLOG */ |
| | | |
| | | /* Define if you have the <unistd.h> header file. */ |
| | | #ifndef LOG4CPP_HAVE_UNISTD_H |
| | | #define LOG4CPP_HAVE_UNISTD_H 1 |
| | | #endif |
| | | |
| | | /* Name of package */ |
| | | #ifndef LOG4CPP_PACKAGE |
| | | #define LOG4CPP_PACKAGE "log4cpp" |
| | | #endif |
| | | |
| | | /* Version number of package */ |
| | | #ifndef LOG4CPP_VERSION |
| | | #define LOG4CPP_VERSION "1.0" |
| | | #endif |
| | | |
| | | /* _INCLUDE_LOG4CPP_CONFIG_OPENVMS_H */ |
| | | #endif |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _INCLUDE_LOG4CPP_CONFIG_WIN32_H |
| | | #define _INCLUDE_LOG4CPP_CONFIG_WIN32_H 1 |
| | | |
| | | /* manually edited from include/log4cpp/config.h */ |
| | | |
| | | /* Define if you have the syslog function. */ |
| | | /* #undef LOG4CPP_HAVE_SYSLOG */ |
| | | |
| | | /* Define if you have the `ftime' function. */ |
| | | #ifndef LOG4CPP_HAVE_FTIME |
| | | #define LOG4CPP_HAVE_FTIME 1 |
| | | #endif |
| | | |
| | | /* Define if you have the `gettimeofday' function. */ |
| | | /* #undef LOG4CPP_HAVE_GETTIMEOFDAY */ |
| | | |
| | | /* define if the compiler has int64_t */ |
| | | #ifndef LOG4CPP_HAVE_INT64_T |
| | | #define LOG4CPP_HAVE_INT64_T |
| | | |
| | | #include <boost/cstdint.hpp> |
| | | using boost::int64_t; |
| | | |
| | | #endif |
| | | |
| | | /* define if the compiler has in_addr_t */ |
| | | #ifndef LOG4CPP_HAVE_IN_ADDR_T |
| | | #define LOG4CPP_HAVE_IN_ADDR_T |
| | | |
| | | #ifndef u_long |
| | | typedef unsigned long u_long; |
| | | #endif |
| | | |
| | | /* u_long is the type of in_addr.s_addr */ |
| | | typedef u_long in_addr_t; |
| | | |
| | | /* u_short is the type of sockaddr_in.sin_port */ |
| | | // typedef u_short in_port_t; |
| | | |
| | | #endif |
| | | |
| | | /* Define if you have the <io.h> header file. */ |
| | | #ifndef LOG4CPP_HAVE_IO_H |
| | | #define LOG4CPP_HAVE_IO_H 1 |
| | | #endif |
| | | |
| | | /* Define if you have the <unistd.h> header file. */ |
| | | /* #undef LOG4CPP_HAVE_UNISTD_H */ |
| | | |
| | | /* Define if you have the idsa library (-lidsa). */ |
| | | /* #undef LOG4CPP_HAVE_LIBIDSA */ |
| | | |
| | | /* Define if you have the `strcasecmp' function. */ |
| | | /* #undef LOG4CPP_HAVE_STRCASECMP */ |
| | | |
| | | /* Name of package */ |
| | | #ifndef LOG4CPP_PACKAGE |
| | | #define LOG4CPP_PACKAGE "log4cpp" |
| | | #endif |
| | | |
| | | /* Version number of package */ |
| | | #ifndef LOG4CPP_VERSION |
| | | #define LOG4CPP_VERSION "1.0" |
| | | #endif |
| | | |
| | | /* define if the compiler implements namespaces */ |
| | | #ifndef LOG4CPP_HAVE_NAMESPACES |
| | | #define LOG4CPP_HAVE_NAMESPACES 1 |
| | | #endif |
| | | |
| | | /* define if the compiler has stringstream */ |
| | | #ifndef LOG4CPP_HAVE_SSTREAM |
| | | #define LOG4CPP_HAVE_SSTREAM 1 |
| | | #endif |
| | | |
| | | #if defined(_MSC_VER) |
| | | # if _MSC_VER < 1300 |
| | | # define LOG4CPP_HAS_WCHAR_T 0 |
| | | # else |
| | | # define LOG4CPP_HAS_WCHAR_T 1 |
| | | # endif |
| | | #else |
| | | # define LOG4CPP_HAS_WCHAR_T 1 |
| | | #endif |
| | | |
| | | /* define if the C library has snprintf */ |
| | | #ifndef LOG4CPP_HAVE_SNPRINTF |
| | | #define LOG4CPP_HAVE_SNPRINTF 1 |
| | | #endif |
| | | |
| | | #if defined(_MSC_VER) && _MSC_VER >= 1300 |
| | | #define LOG4CPP_HAVE_LOCALTIME_R 1 |
| | | #endif |
| | | |
| | | /* define to get around problems with ERROR in windows.h */ |
| | | #ifndef LOG4CPP_FIX_ERROR_COLLISION |
| | | #define LOG4CPP_FIX_ERROR_COLLISION 1 |
| | | #endif |
| | | |
| | | /* define WIN32 for Borland */ |
| | | #ifndef WIN32 |
| | | #define WIN32 |
| | | #endif |
| | | |
| | | /* use threads */ |
| | | #ifndef LOG4CPP_HAVE_THREADING |
| | | #define LOG4CPP_HAVE_THREADING |
| | | #endif |
| | | |
| | | /* use boost threads */ |
| | | #ifndef LOG4CPP_USE_BOOSTTHREADS |
| | | #define LOG4CPP_USE_BOOSTTHREADS |
| | | #endif |
| | | |
| | | /* supply DLL main */ |
| | | #ifndef LOG4CPP_SUPPLY_DLLMAIN |
| | | #define LOG4CPP_SUPPLY_DLLMAIN |
| | | #endif |
| | | |
| | | /* MSVCs <cstdlib> and <cstring> headers are broken in the sense that they |
| | | put functions in the global namespace instead of std:: |
| | | The #defines below enable a workaround for MSVC 6 and lower. If MSVC 7 |
| | | is still broken please adjust the _MSC_VER version check and report it. |
| | | See also bug report #628211. |
| | | */ |
| | | #if defined(_MSC_VER) && _MSC_VER < 1300 |
| | | |
| | | #ifndef LOG4CPP_CSTDLIB_NOT_IN_STD |
| | | #define LOG4CPP_CSTDLIB_NOT_IN_STD |
| | | #endif |
| | | |
| | | #ifndef LOG4CPP_CSTRING_NOT_IN_STD |
| | | #define LOG4CPP_CSTRING_NOT_IN_STD |
| | | #endif |
| | | |
| | | #ifndef LOG4CPP_CTIME_NOT_IN_STD |
| | | #define LOG4CPP_CTIME_NOT_IN_STD |
| | | #endif |
| | | |
| | | #ifndef LOG4CPP_CMATH_NOT_IN_STD |
| | | #define LOG4CPP_CMATH_NOT_IN_STD |
| | | #endif |
| | | |
| | | #endif |
| | | |
| | | /* define mode_t. Move to Portability.hh if more platforms need it */ |
| | | typedef int mode_t; |
| | | |
| | | /* _INCLUDE_LOG4CPP_CONFIG_WIN32_H */ |
| | | #endif |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _INCLUDE_LOG4CPP_CONFIG_WIN32_H |
| | | #define _INCLUDE_LOG4CPP_CONFIG_WIN32_H 1 |
| | | |
| | | /* manually edited from include/log4cpp/config.h */ |
| | | |
| | | /* Define if you have the syslog function. */ |
| | | /* #undef LOG4CPP_HAVE_SYSLOG */ |
| | | |
| | | /* Define if you have the `ftime' function. */ |
| | | #ifndef LOG4CPP_HAVE_FTIME |
| | | #define LOG4CPP_HAVE_FTIME 1 |
| | | #endif |
| | | |
| | | /* Define if you have the `gettimeofday' function. */ |
| | | /* #undef LOG4CPP_HAVE_GETTIMEOFDAY */ |
| | | |
| | | /* define if the compiler has int64_t */ |
| | | #ifndef LOG4CPP_HAVE_INT64_T |
| | | #define LOG4CPP_HAVE_INT64_T |
| | | typedef __int64 int64_t; |
| | | |
| | | /* define if the compiler has in_addr_t */ |
| | | #ifndef LOG4CPP_HAVE_IN_ADDR_T |
| | | #define LOG4CPP_HAVE_IN_ADDR_T |
| | | |
| | | #ifndef u_long |
| | | typedef unsigned long u_long; |
| | | #endif |
| | | |
| | | /* u_long is the type of in_addr.s_addr */ |
| | | typedef u_long in_addr_t; |
| | | |
| | | /* u_short is the type of sockaddr_in.sin_port */ |
| | | // typedef u_short in_port_t; |
| | | |
| | | #endif |
| | | |
| | | #if defined(_MSC_VER) && _MSC_VER < 1300 |
| | | #define LOG4CPP_MISSING_INT64_OSTREAM_OP |
| | | #endif |
| | | |
| | | #endif |
| | | |
| | | /* Define if you have the <io.h> header file. */ |
| | | #ifndef LOG4CPP_HAVE_IO_H |
| | | #define LOG4CPP_HAVE_IO_H 1 |
| | | #endif |
| | | |
| | | /* Define if you have the <unistd.h> header file. */ |
| | | /* #undef LOG4CPP_HAVE_UNISTD_H */ |
| | | |
| | | /* Define if you have the idsa library (-lidsa). */ |
| | | /* #undef LOG4CPP_HAVE_LIBIDSA */ |
| | | |
| | | /* Define if you have the `strcasecmp' function. */ |
| | | /* #undef LOG4CPP_HAVE_STRCASECMP */ |
| | | |
| | | /* Name of package */ |
| | | #ifndef LOG4CPP_PACKAGE |
| | | #define LOG4CPP_PACKAGE "log4cpp" |
| | | #endif |
| | | |
| | | /* Version number of package */ |
| | | #ifndef LOG4CPP_VERSION |
| | | #define LOG4CPP_VERSION "1.0" |
| | | #endif |
| | | |
| | | /* define if the compiler implements namespaces */ |
| | | #ifndef LOG4CPP_HAVE_NAMESPACES |
| | | #define LOG4CPP_HAVE_NAMESPACES 1 |
| | | #endif |
| | | |
| | | /* define if the compiler has stringstream */ |
| | | #ifndef LOG4CPP_HAVE_SSTREAM |
| | | #define LOG4CPP_HAVE_SSTREAM 1 |
| | | #endif |
| | | |
| | | #if defined(_MSC_VER) |
| | | # if _MSC_VER < 1300 |
| | | # define LOG4CPP_HAS_WCHAR_T 0 |
| | | # else |
| | | # define LOG4CPP_HAS_WCHAR_T 1 |
| | | # endif |
| | | #else |
| | | # define LOG4CPP_HAS_WCHAR_T 1 |
| | | #endif |
| | | |
| | | /* define if the C library has snprintf */ |
| | | #ifndef LOG4CPP_HAVE_SNPRINTF |
| | | #define LOG4CPP_HAVE_SNPRINTF 1 |
| | | #endif |
| | | |
| | | #if defined(_MSC_VER) && _MSC_VER >= 1300 |
| | | #define LOG4CPP_HAVE_LOCALTIME_R 1 |
| | | #endif |
| | | |
| | | /* define to get around problems with ERROR in windows.h */ |
| | | #ifndef LOG4CPP_FIX_ERROR_COLLISION |
| | | #define LOG4CPP_FIX_ERROR_COLLISION 1 |
| | | #endif |
| | | |
| | | /* define WIN32 for Borland */ |
| | | #ifndef WIN32 |
| | | #define WIN32 |
| | | #endif |
| | | |
| | | /* use threads */ |
| | | #ifndef LOG4CPP_HAVE_THREADING |
| | | #define LOG4CPP_HAVE_THREADING |
| | | #endif |
| | | |
| | | /* use ms threads */ |
| | | #ifndef LOG4CPP_USE_MSTHREADS |
| | | #define LOG4CPP_USE_MSTHREADS |
| | | #endif |
| | | |
| | | /* supply DLL main */ |
| | | #ifndef LOG4CPP_SUPPLY_DLLMAIN |
| | | #define LOG4CPP_SUPPLY_DLLMAIN |
| | | #endif |
| | | |
| | | /* MSVCs <cstdlib> and <cstring> headers are broken in the sense that they |
| | | put functions in the global namespace instead of std:: |
| | | The #defines below enable a workaround for MSVC 6 and lower. If MSVC 7 |
| | | is still broken please adjust the _MSC_VER version check and report it. |
| | | See also bug report #628211. |
| | | */ |
| | | #if defined(_MSC_VER) && _MSC_VER < 1300 |
| | | |
| | | #ifndef LOG4CPP_CSTDLIB_NOT_IN_STD |
| | | #define LOG4CPP_CSTDLIB_NOT_IN_STD |
| | | #endif |
| | | |
| | | #ifndef LOG4CPP_CSTRING_NOT_IN_STD |
| | | #define LOG4CPP_CSTRING_NOT_IN_STD |
| | | #endif |
| | | |
| | | #ifndef LOG4CPP_CTIME_NOT_IN_STD |
| | | #define LOG4CPP_CTIME_NOT_IN_STD |
| | | #endif |
| | | |
| | | #ifndef LOG4CPP_CMATH_NOT_IN_STD |
| | | #define LOG4CPP_CMATH_NOT_IN_STD |
| | | #endif |
| | | |
| | | #endif |
| | | |
| | | /* define mode_t. Move to Portability.hh if more platforms need it */ |
| | | #if !defined(__BORLANDC__) |
| | | typedef int mode_t; |
| | | #endif |
| | | |
| | | #if defined(_MSC_VER) && _MSC_VER == 1310 |
| | | // warning C4275: interface non dll class 'std::runtime_error' utilis閑 comme base |
| | | // d'une interface dll class 'log4cpp::ConfigureFailure' |
| | | #pragma warning(disable: 4275) |
| | | #endif |
| | | |
| | | /* _INCLUDE_LOG4CPP_CONFIG_WIN32_H */ |
| | | #endif |
New file |
| | |
| | | /* |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef LOG4CPP_CONVENIENCE_H |
| | | #define LOG4CPP_CONVENIENCE_H |
| | | |
| | | #define LOG4CPP_LOGGER(name) \ |
| | | static log4cpp::Category& logger = log4cpp::Category::getInstance( name ); |
| | | |
| | | #define LOG4CPP_LOGGER_N(var_name, name) \ |
| | | static log4cpp::Category& var_name = log4cpp::Category::getInstance( name ); |
| | | |
| | | // simple logging |
| | | #define LOG4CPP_EMERG(logger, msg) \ |
| | | if (logger.isEmergEnabled()) logger.emerg( msg ); |
| | | |
| | | #define LOG4CPP_FATAL(logger, msg) \ |
| | | if (logger.isFatalEnabled()) logger.fatal( msg ); |
| | | |
| | | #define LOG4CPP_ALERT(logger, msg) \ |
| | | if (logger.isAlertEnabled()) logger.alert( msg ); |
| | | |
| | | #define LOG4CPP_CRIT(logger, msg) \ |
| | | if (logger.isCritEnabled()) logger.crit( msg ); |
| | | |
| | | #define LOG4CPP_ERROR(logger, msg) \ |
| | | if (logger.isErrorEnabled()) logger.error( msg ); |
| | | |
| | | #define LOG4CPP_WARN(logger, msg) \ |
| | | if (logger.isWarnEnabled()) logger.warn( msg ); |
| | | |
| | | #define LOG4CPP_NOTICE(logger, msg) \ |
| | | if (logger.isNoticeEnabled()) logger.notice( msg ); |
| | | |
| | | #define LOG4CPP_INFO(logger, msg) \ |
| | | if (logger.isInfoEnabled()) logger.info( msg ); |
| | | |
| | | #define LOG4CPP_DEBUG(logger, msg) \ |
| | | if (logger.isDebugEnabled()) logger.debug( msg ); |
| | | |
| | | |
| | | // stream logging |
| | | #define LOG4CPP_EMERG_S(logger) \ |
| | | if (logger.isEmergEnabled()) logger.emergStream() |
| | | |
| | | #define LOG4CPP_FATAL_S(logger) \ |
| | | if (logger.isFatalEnabled()) logger.fatalStream() |
| | | |
| | | #define LOG4CPP_ALERT_S(logger) \ |
| | | if (logger.isAlertEnabled()) logger.alertStream() |
| | | |
| | | #define LOG4CPP_CRIT_S(logger) \ |
| | | if (logger.isCritEnabled()) logger.critStream() |
| | | |
| | | #define LOG4CPP_ERROR_S(logger) \ |
| | | if (logger.isErrorEnabled()) logger.errorStream() |
| | | |
| | | #define LOG4CPP_WARN_S(logger) \ |
| | | if (logger.isWarnEnabled()) logger.warnStream() |
| | | |
| | | #define LOG4CPP_NOTICE_S(logger) \ |
| | | if (logger.isNoticeEnabled()) logger.noticeStream() |
| | | |
| | | #define LOG4CPP_INFO_S(logger) \ |
| | | if (logger.isInfoEnabled()) logger.infoStream() |
| | | |
| | | #define LOG4CPP_DEBUG_S(logger) \ |
| | | if (logger.isDebugEnabled()) logger.debugStream() |
| | | |
| | | |
| | | // stream logging with default logger "logger" |
| | | #define LOG4CPP_EMERG_SD() \ |
| | | if (logger.isEmergEnabled()) logger.emergStream() |
| | | |
| | | #define LOG4CPP_FATAL_SD() \ |
| | | if (logger.isFatalEnabled()) logger.fatalStream() |
| | | |
| | | #define LOG4CPP_ALERT_SD() \ |
| | | if (logger.isAlertEnabled()) logger.alertStream() |
| | | |
| | | #define LOG4CPP_CRIT_SD() \ |
| | | if (logger.isCritEnabled()) logger.critStream() |
| | | |
| | | #define LOG4CPP_ERROR_SD() \ |
| | | if (logger.isErrorEnabled()) logger.errorStream() |
| | | |
| | | #define LOG4CPP_WARN_SD() \ |
| | | if (logger.isWarnEnabled()) logger.warnStream() |
| | | |
| | | #define LOG4CPP_NOTICE_SD() \ |
| | | if (logger.isNoticeEnabled()) logger.noticeStream() |
| | | |
| | | #define LOG4CPP_INFO_SD() \ |
| | | if (logger.isInfoEnabled()) logger.infoStream() |
| | | |
| | | #define LOG4CPP_DEBUG_SD() \ |
| | | if (logger.isDebugEnabled()) logger.debugStream() |
| | | |
| | | #endif |
| | | |
New file |
| | |
| | | /* |
| | | * BoostThreads.hh |
| | | * |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_THREADING_BOOSTTHREADS_HH |
| | | #define _LOG4CPP_THREADING_BOOSTTHREADS_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <boost/thread/thread.hpp> |
| | | #include <boost/thread/mutex.hpp> |
| | | #include <boost/thread/tss.hpp> |
| | | #include <cstdio> |
| | | #include <string> |
| | | |
| | | namespace log4cpp { |
| | | namespace threading { |
| | | static std::string getThreadId() { |
| | | char buffer[14]; |
| | | // Boost.Threads stores the thread ID but doesn't expose it |
| | | sprintf(buffer, "not available"); |
| | | return std::string(buffer); |
| | | }; |
| | | |
| | | typedef boost::mutex Mutex; |
| | | typedef boost::mutex::scoped_lock ScopedLock; |
| | | |
| | | template<typename T> class ThreadLocalDataHolder { |
| | | public: |
| | | inline T* get() const { |
| | | return _localData.get(); |
| | | }; |
| | | |
| | | inline T* operator->() const { return _localData.get(); }; |
| | | inline T& operator*() const { return *_localData.get(); }; |
| | | |
| | | inline T* release() { |
| | | return _localData.release(); |
| | | }; |
| | | |
| | | inline void reset(T* p = NULL) { |
| | | _localData.reset(p); |
| | | }; |
| | | |
| | | private: |
| | | boost::thread_specific_ptr<T> _localData; |
| | | }; |
| | | |
| | | } |
| | | } |
| | | #endif |
New file |
| | |
| | | /* |
| | | * DummyThreads.hh |
| | | * |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_THREADING_DUMMYTHREADS_HH |
| | | #define _LOG4CPP_THREADING_DUMMYTHREADS_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <stdio.h> |
| | | #include <string> |
| | | |
| | | namespace log4cpp { |
| | | namespace threading { |
| | | std::string getThreadId(); |
| | | |
| | | /** |
| | | Dummy type 'int' for Mutex. Yes, this adds a bit of overhead in |
| | | the for of extra memory, but unfortunately 'void' is illegal. |
| | | **/ |
| | | typedef int Mutex; |
| | | |
| | | /** |
| | | Dummy type 'int' defintion of ScopedLock; |
| | | **/ |
| | | typedef int ScopedLock; |
| | | |
| | | template<typename T> class ThreadLocalDataHolder { |
| | | public: |
| | | typedef T data_type; |
| | | |
| | | inline ThreadLocalDataHolder() {}; |
| | | inline ~ThreadLocalDataHolder() { |
| | | if (_data) |
| | | delete _data; |
| | | }; |
| | | |
| | | inline T* get() const { |
| | | return _data; |
| | | }; |
| | | |
| | | inline T* operator->() const { return get(); }; |
| | | inline T& operator*() const { return *get(); }; |
| | | |
| | | inline T* release() { |
| | | T* result = _data; |
| | | _data = NULL; |
| | | |
| | | return result; |
| | | }; |
| | | |
| | | inline void reset(T* p = NULL) { |
| | | if (_data) |
| | | delete _data; |
| | | _data = p; |
| | | }; |
| | | |
| | | private: |
| | | T* _data; |
| | | }; |
| | | } |
| | | } |
| | | #endif |
New file |
| | |
| | | /* |
| | | * MSThreads.hh |
| | | * |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_THREADING_MSTHREADS_HH |
| | | #define _LOG4CPP_THREADING_MSTHREADS_HH |
| | | |
| | | #include <string> |
| | | |
| | | // deal with ERROR #define |
| | | // N.B. This #includes windows.h with NOGDI and WIN32_LEAN_AND_MEAN #defined. |
| | | // If this is not what the user wants, #include windows.h before this file. |
| | | #ifndef _WINDOWS_ |
| | | # ifndef NOGDI |
| | | # define NOGDI // this will circumvent the ERROR #define in windows.h |
| | | # define LOG4CPP_UNDEFINE_NOGDI |
| | | # endif |
| | | |
| | | # ifndef WIN32_LEAN_AND_MEAN |
| | | # define WIN32_LEAN_AND_MEAN |
| | | # define LOG4CPP_UNDEFINE_WIN32_LEAN_AND_MEAN |
| | | # endif |
| | | |
| | | # include <windows.h> |
| | | |
| | | # ifdef LOG4CPP_UNDEFINE_NOGDI |
| | | # undef NOGDI |
| | | # endif |
| | | |
| | | # ifdef LOG4CPP_UNDEFINE_WIN32_LEAN_AND_MEAN |
| | | # undef WIN32_LEAN_AND_MEAN |
| | | # endif |
| | | |
| | | #endif // done dealing with ERROR #define |
| | | |
| | | namespace log4cpp { |
| | | namespace threading { |
| | | /** |
| | | * Return an identifier for the current thread. What these |
| | | * identifiers look like is completely up to the underlying |
| | | * thread library. |
| | | **/ |
| | | std::string getThreadId(); |
| | | |
| | | /** |
| | | * A simple object wrapper around CreateMutex() and DeleteMutex() |
| | | */ |
| | | class LOG4CPP_EXPORT MSMutex { |
| | | public: |
| | | MSMutex() { InitializeCriticalSection(&_criticalSection); } |
| | | ~MSMutex() { DeleteCriticalSection(&_criticalSection); } |
| | | inline LPCRITICAL_SECTION getCriticalSection() { |
| | | return &_criticalSection; |
| | | } |
| | | |
| | | private: |
| | | MSMutex(const MSMutex& other); |
| | | CRITICAL_SECTION _criticalSection; |
| | | }; |
| | | |
| | | /** |
| | | * A simple, non recursive Mutex. |
| | | **/ |
| | | typedef MSMutex Mutex; |
| | | |
| | | /** |
| | | * A simple object wrapper around WaitForSingleObject() and |
| | | * ReleaseMutex() |
| | | */ |
| | | class MSScopedLock { |
| | | public: |
| | | MSScopedLock(MSMutex& mutex) { |
| | | _criticalSection = mutex.getCriticalSection(); |
| | | EnterCriticalSection(_criticalSection); |
| | | } |
| | | |
| | | ~MSScopedLock() { LeaveCriticalSection(_criticalSection); } |
| | | |
| | | private: |
| | | MSScopedLock(const MSScopedLock& other); |
| | | LPCRITICAL_SECTION _criticalSection; |
| | | }; |
| | | |
| | | /** |
| | | * A simple "resource acquisition is initialization" idiom type lock |
| | | * for Mutex. |
| | | **/ |
| | | typedef MSScopedLock ScopedLock; |
| | | |
| | | /** |
| | | * This class holds Thread local data of type T, i.e. for each |
| | | * thread a ThreadLocalDataHolder holds 0 or 1 instance of T. |
| | | * The held object must be heap allocated and will be deleted |
| | | * upon termination of the thread to which it belongs. |
| | | **/ |
| | | template<typename T> class ThreadLocalDataHolder { |
| | | public: |
| | | inline ThreadLocalDataHolder() : |
| | | _key(TlsAlloc()) {}; |
| | | |
| | | inline ~ThreadLocalDataHolder() { TlsFree(_key); }; |
| | | |
| | | /** |
| | | * Obtains the Object held for the current thread. |
| | | * @return a pointer to the held Object or NULL if no |
| | | * Object has been set for the current thread. |
| | | **/ |
| | | inline T* get() const { |
| | | return (T*)TlsGetValue(_key); |
| | | }; |
| | | |
| | | /** |
| | | * Obtains the Object held for the current thread. |
| | | * Initially each thread holds NULL. |
| | | * @return a pointer to the held Object or NULL if no |
| | | * Object has been set for the current thread. |
| | | **/ |
| | | inline T* operator->() const { return get(); }; |
| | | |
| | | /** |
| | | * Obtains the Object held for the current thread. |
| | | * @pre get() != NULL |
| | | * @return a reference to the held Object. |
| | | **/ |
| | | inline T& operator*() const { return *get(); }; |
| | | |
| | | /** |
| | | * Releases the Object held for the current thread. |
| | | * @post get() == NULL |
| | | * @return a pointer to the Object thas was held for |
| | | * the current thread or NULL if no Object was held. |
| | | **/ |
| | | inline T* release() { |
| | | T* result = (T*)TlsGetValue(_key); |
| | | TlsSetValue(_key, NULL); |
| | | return result; |
| | | }; |
| | | |
| | | /** |
| | | * Sets a new Object to be held for the current thread. A |
| | | * previously set Object will be deleted. |
| | | * @param p the new object to hold. |
| | | * @post get() == p |
| | | **/ |
| | | inline void reset(T* p = NULL) { |
| | | T* thing = (T*)TlsGetValue(_key); |
| | | delete thing; |
| | | TlsSetValue(_key, p); |
| | | }; |
| | | |
| | | private: |
| | | DWORD _key; |
| | | }; |
| | | } |
| | | } |
| | | #endif |
New file |
| | |
| | | liblog4cppincludedir = $(includedir)/log4cpp/threading |
| | | liblog4cppinclude_HEADERS = \ |
| | | BoostThreads.hh \ |
| | | DummyThreads.hh \ |
| | | OmniThreads.hh \ |
| | | PThreads.hh \ |
| | | MSThreads.hh \ |
| | | Threading.hh |
New file |
| | |
| | | /* |
| | | * OmniThreads.hh |
| | | * |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_THREADING_OMNITHREADS_HH |
| | | #define _LOG4CPP_THREADING_OMNITHREADS_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <omnithread.h> |
| | | #include <stdio.h> |
| | | #include <string> |
| | | |
| | | namespace log4cpp { |
| | | namespace threading { |
| | | /** |
| | | * Return an identifier for the current thread. What these |
| | | * identifiers look like is completely up to the underlying |
| | | * thread library. OmniThreads returns the POSIX thread Id. |
| | | **/ |
| | | std::string getThreadId(); |
| | | |
| | | /** |
| | | * A simple, non recursive Mutex. |
| | | * Equivalent to Boost.Threads boost::mutex |
| | | **/ |
| | | typedef omni_mutex Mutex; |
| | | |
| | | /** |
| | | * A simple "resource acquisition is initialization" idiom type lock |
| | | * for Mutex. |
| | | * Equivalent to Boost.Threads boost::scoped_lock. |
| | | **/ |
| | | typedef omni_mutex_lock ScopedLock; |
| | | |
| | | /** |
| | | * This class holds Thread local data of type T, i.e. for each |
| | | * thread a ThreadLocalDataHolder holds 0 or 1 instance of T. |
| | | * The held object must be heap allocated and will be deleted |
| | | * upon termination of the thread to wich it belongs. |
| | | * This is an omni_threads based equivalent of Boost.Threads |
| | | * thread_specific_ptr<T> class. |
| | | **/ |
| | | template<typename T> class ThreadLocalDataHolder { |
| | | public: |
| | | typedef T data_type; |
| | | |
| | | inline ThreadLocalDataHolder() : |
| | | _key(omni_thread::allocate_key()) {}; |
| | | |
| | | inline ~ThreadLocalDataHolder() {}; |
| | | |
| | | /** |
| | | * Obtains the Object held for the current thread. |
| | | * @return a pointer to the held Object or NULL if no |
| | | * Object has been set for the current thread. |
| | | **/ |
| | | inline T* get() const { |
| | | Holder* holder = dynamic_cast<Holder*>( |
| | | ::omni_thread::self()->get_value(_key)); |
| | | return (holder) ? holder->data : NULL; |
| | | }; |
| | | |
| | | /** |
| | | * Obtains the Object held for the current thread. |
| | | * Initially each thread holds NULL. |
| | | * @return a pointer to the held Object or NULL if no |
| | | * Object has been set for the current thread. |
| | | **/ |
| | | inline T* operator->() const { return get(); }; |
| | | |
| | | /** |
| | | * Obtains the Object held for the current thread. |
| | | * @pre get() != NULL |
| | | * @return a reference to the held Object. |
| | | **/ |
| | | inline T& operator*() const { return *get(); }; |
| | | |
| | | /** |
| | | * Releases the Object held for the current thread. |
| | | * @post get() == NULL |
| | | * @return a pointer to the Object thas was held for |
| | | * the current thread or NULL if no Object was held. |
| | | **/ |
| | | inline T* release() { |
| | | T* result = NULL; |
| | | Holder* holder = dynamic_cast<Holder*>( |
| | | ::omni_thread::self()->get_value(_key)); |
| | | |
| | | if (holder) { |
| | | result = holder->data; |
| | | holder->data = NULL; |
| | | } |
| | | |
| | | return result; |
| | | }; |
| | | |
| | | /** |
| | | * Sets a new Object to be held for the current thread. A |
| | | * previously set Object will be deleted. |
| | | * @param p the new object to hold. |
| | | * @post get() == p |
| | | **/ |
| | | inline void reset(T* p = NULL) { |
| | | Holder* holder = dynamic_cast<Holder*>( |
| | | ::omni_thread::self()->get_value(_key)); |
| | | if (holder) { |
| | | if (holder->data) |
| | | delete holder->data; |
| | | |
| | | holder->data = p; |
| | | } else { |
| | | holder = new Holder(p); |
| | | ::omni_thread::self()->set_value(_key, holder); |
| | | } |
| | | }; |
| | | |
| | | private: |
| | | class Holder : public omni_thread::value_t { |
| | | public: |
| | | Holder(data_type* data) : data(data) {}; |
| | | virtual ~Holder() { if (data) delete (data); }; |
| | | data_type* data; |
| | | private: |
| | | Holder(const Holder& other); |
| | | Holder& operator=(const Holder& other); |
| | | }; |
| | | |
| | | omni_thread::key_t _key; |
| | | }; |
| | | } |
| | | } |
| | | #endif |
New file |
| | |
| | | /* |
| | | * PThreads.hh |
| | | * |
| | | * Copyright 2002, Emiliano Martin emilianomc@terra.es All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_THREADING_PTHREADS_HH |
| | | #define _LOG4CPP_THREADING_PTHREADS_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | #include <stdio.h> |
| | | #include <pthread.h> |
| | | #include <string> |
| | | #include <assert.h> |
| | | |
| | | |
| | | namespace log4cpp { |
| | | namespace threading { |
| | | |
| | | /** |
| | | * returns the thread ID |
| | | **/ |
| | | std::string getThreadId(); |
| | | |
| | | /** |
| | | **/ |
| | | class Mutex { |
| | | private: |
| | | pthread_mutex_t mutex; |
| | | |
| | | public: |
| | | inline Mutex() { |
| | | ::pthread_mutex_init(&mutex, NULL); |
| | | } |
| | | |
| | | inline void lock() { |
| | | ::pthread_mutex_lock(&mutex); |
| | | } |
| | | |
| | | inline void unlock() { |
| | | ::pthread_mutex_unlock(&mutex); |
| | | } |
| | | |
| | | inline ~Mutex() { |
| | | ::pthread_mutex_destroy(&mutex); |
| | | } |
| | | |
| | | private: |
| | | Mutex(const Mutex& m); |
| | | Mutex& operator=(const Mutex &m); |
| | | }; |
| | | |
| | | /** |
| | | * definition of ScopedLock; |
| | | **/ |
| | | class ScopedLock { |
| | | private: |
| | | Mutex& _mutex; |
| | | |
| | | public: |
| | | inline ScopedLock(Mutex& mutex) : |
| | | _mutex(mutex) { |
| | | _mutex.lock(); |
| | | } |
| | | |
| | | inline ~ScopedLock() { |
| | | _mutex.unlock(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * |
| | | **/ |
| | | template<typename T> class ThreadLocalDataHolder { |
| | | private: |
| | | pthread_key_t _key; |
| | | |
| | | public: |
| | | typedef T data_type; |
| | | |
| | | inline ThreadLocalDataHolder() { |
| | | ::pthread_key_create(&_key, freeHolder); |
| | | } |
| | | |
| | | inline static void freeHolder(void *p) { |
| | | assert(p != NULL); |
| | | delete reinterpret_cast<T *>(p); |
| | | } |
| | | |
| | | inline ~ThreadLocalDataHolder() { |
| | | T *data = get(); |
| | | if (data != NULL) { |
| | | delete data; |
| | | } |
| | | ::pthread_key_delete(_key); |
| | | } |
| | | |
| | | inline T* get() const { |
| | | return reinterpret_cast<T *>(::pthread_getspecific(_key)); |
| | | } |
| | | |
| | | inline T* operator->() const { return get(); } |
| | | inline T& operator*() const { return *get(); } |
| | | |
| | | inline T* release() { |
| | | T* result = get(); |
| | | ::pthread_setspecific(_key, NULL); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | inline void reset(T* p = NULL) { |
| | | T *data = get(); |
| | | if (data != NULL) { |
| | | delete data; |
| | | } |
| | | ::pthread_setspecific(_key, p); |
| | | } |
| | | }; |
| | | |
| | | } |
| | | } |
| | | #endif |
New file |
| | |
| | | /* |
| | | * Threading.hh |
| | | * |
| | | * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. |
| | | * Copyright 2002, Bastiaan Bakker. All rights reserved. |
| | | * |
| | | * See the COPYING file for the terms of usage and distribution. |
| | | */ |
| | | |
| | | #ifndef _LOG4CPP_THREADING_THREADING_HH |
| | | #define _LOG4CPP_THREADING_THREADING_HH |
| | | |
| | | #include <log4cpp/Portability.hh> |
| | | |
| | | #ifdef LOG4CPP_HAVE_THREADING |
| | | |
| | | #ifdef LOG4CPP_USE_OMNITHREADS |
| | | #include <log4cpp/threading/OmniThreads.hh> |
| | | #endif |
| | | |
| | | #ifdef LOG4CPP_USE_BOOSTTHREADS |
| | | #include <log4cpp/threading/BoostThreads.hh> |
| | | #endif |
| | | |
| | | #ifdef LOG4CPP_USE_MSTHREADS |
| | | #include <log4cpp/threading/MSThreads.hh> |
| | | #endif |
| | | |
| | | #ifdef LOG4CPP_USE_PTHREADS |
| | | #include <log4cpp/threading/PThreads.hh> |
| | | #endif |
| | | |
| | | #else /* LOG4CPP_HAVE_THREADING */ |
| | | #include <log4cpp/threading/DummyThreads.hh> |
| | | #endif /* LOG4CPP_HAVE_THREADING */ |
| | | |
| | | #endif |