Улучшен алгоритм распознавания ошибок
This commit is contained in:
parent
fa93e2988f
commit
81a1fed232
43
Compare.c
43
Compare.c
|
|
@ -26,6 +26,8 @@ typedef struct {
|
|||
wchar_t pathWav2[_MAX_PATH];
|
||||
BOOL error;
|
||||
int number;
|
||||
BOOL isFindResult;
|
||||
wchar_t textResult[_MAX_PATH];
|
||||
} tCompareStruct;
|
||||
|
||||
|
||||
|
|
@ -175,21 +177,25 @@ static BOOL CALLBACK enum_wnd_proc(HWND hwnd, LPARAM lParam) {
|
|||
#ifdef DEBUG_PRINTF
|
||||
printf("Static found!\n");
|
||||
#endif
|
||||
wchar_t text[_MAX_PATH];
|
||||
wcscpy_s(text, _MAX_PATH, L" ");
|
||||
//wchar_t text[_MAX_PATH];
|
||||
//wcscpy_s(text, _MAX_PATH, L" ");
|
||||
|
||||
for (int i = 0; i < 50; ++i) {
|
||||
SendMessage(hwnd, WM_GETTEXT, _MAX_PATH, (LPARAM)text);
|
||||
wcscpy_s(compareStruct->textResult, _MAX_PATH, L" ");
|
||||
|
||||
if (wcscmp(text, L" -200.0%") == 0) {
|
||||
compareStruct->isFindResult = FALSE;
|
||||
|
||||
for (int i = 0; i < 25; ++i) {
|
||||
SendMessage(hwnd, WM_GETTEXT, _MAX_PATH, (LPARAM)compareStruct->textResult);
|
||||
|
||||
if (wcscmp(compareStruct->textResult, L" -200.0%") == 0) {
|
||||
Sleep(100);
|
||||
}
|
||||
else {
|
||||
compareStruct->isFindResult = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Similarity Score:%ls\n", text);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -278,6 +284,31 @@ int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) {
|
|||
compareStruct.number = 0;
|
||||
EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct));
|
||||
|
||||
if (compareStruct.isFindResult) {
|
||||
printf("Similarity Score:%ls\n", compareStruct.textResult);
|
||||
}
|
||||
else {
|
||||
GetWindowRect(hwnd, &compareStruct.winRect);
|
||||
compareStruct.regim = REGIM_INIT;
|
||||
compareStruct.number = 0;
|
||||
EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct));
|
||||
|
||||
if (compareStruct.error)
|
||||
return 3;
|
||||
|
||||
compareStruct.regim = REGIM_COMPARE;
|
||||
compareStruct.number = 0;
|
||||
EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct));
|
||||
|
||||
compareStruct.regim = REGIM_RESULT;
|
||||
compareStruct.number = 0;
|
||||
EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct));
|
||||
|
||||
printf("Similarity Score:%ls\n", compareStruct.textResult);
|
||||
|
||||
}
|
||||
|
||||
|
||||
timeKillEvent(timerUpdate);
|
||||
|
||||
//PostMessage(hwnd, WM_CLOSE, 0, 0);
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1,6 +1,7 @@
|
|||
Compare.c
|
||||
Создание кода
|
||||
Создание кода завершено
|
||||
Previous IPDB and IOBJ mismatch, fall back to full compilation.
|
||||
All 8 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
1 of 8 functions (12.5%) were compiled, the rest were copied from previous compilation.
|
||||
0 functions were new in current compilation
|
||||
0 functions had inline decision re-evaluated but remain unchanged
|
||||
Compare.vcxproj -> C:\VC\Compare\Release\Compare.exe
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue