| 192 | if (group) |
| 193 | { |
| 194 | macro = group->macros.find([¯o_name](Macro& macro) -> bool { return macro_name == macro.name; }); |
| 195 | } |
| 196 | return macro; |
| 197 | } |
| 198 | |
| 199 | void InitOcr(bool warning) |
| 200 | { |
| 201 | #ifndef DEBUG |
| 202 | #ifdef QIOCR_SHARED |
| 203 | std::wstring dll = L"OCR\\qiocr.dll"; |
| 204 | if (!File::FileExist(dll)) |
| 205 | { |
| 206 | if (warning) MsgBox::Warning(L"没有安装文字识别功能"); |
| 207 | return; |
| 208 | } |
| 209 | Qi::ocr_ver = QiOcrVersion(dll); |
| 210 | if (Qi::ocr_ver < 3) |
| 211 | { |
| 212 | MsgBox::Warning(L"文字识别版本低于3,需要更新"); |
| 213 | return; |
| 214 | } |
| 215 | #endif |
| 216 | #ifndef QIOCR_INTERNAL |
| 217 | std::wstring rec = L"ppocr.onnx"; |
| 218 | std::wstring keys = L"ppocr.keys"; |