Улучшен алгоритм распознавания ошибок
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];
|
wchar_t pathWav2[_MAX_PATH];
|
||||||
BOOL error;
|
BOOL error;
|
||||||
int number;
|
int number;
|
||||||
|
BOOL isFindResult;
|
||||||
|
wchar_t textResult[_MAX_PATH];
|
||||||
} tCompareStruct;
|
} tCompareStruct;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -175,21 +177,25 @@ static BOOL CALLBACK enum_wnd_proc(HWND hwnd, LPARAM lParam) {
|
||||||
#ifdef DEBUG_PRINTF
|
#ifdef DEBUG_PRINTF
|
||||||
printf("Static found!\n");
|
printf("Static found!\n");
|
||||||
#endif
|
#endif
|
||||||
wchar_t text[_MAX_PATH];
|
//wchar_t text[_MAX_PATH];
|
||||||
wcscpy_s(text, _MAX_PATH, L" ");
|
//wcscpy_s(text, _MAX_PATH, L" ");
|
||||||
|
|
||||||
for (int i = 0; i < 50; ++i) {
|
wcscpy_s(compareStruct->textResult, _MAX_PATH, L" ");
|
||||||
SendMessage(hwnd, WM_GETTEXT, _MAX_PATH, (LPARAM)text);
|
|
||||||
|
|
||||||
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);
|
Sleep(100);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
compareStruct->isFindResult = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Similarity Score:%ls\n", text);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -278,6 +284,31 @@ int wmain(int argc, wchar_t* argv[], wchar_t* envp[]) {
|
||||||
compareStruct.number = 0;
|
compareStruct.number = 0;
|
||||||
EnumChildWindows(hwnd, enum_wnd_proc, (LPARAM)(&compareStruct));
|
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);
|
timeKillEvent(timerUpdate);
|
||||||
|
|
||||||
//PostMessage(hwnd, WM_CLOSE, 0, 0);
|
//PostMessage(hwnd, WM_CLOSE, 0, 0);
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,6 +1,7 @@
|
||||||
Compare.c
|
Compare.c
|
||||||
Создание кода
|
Создание кода
|
||||||
Создание кода завершено
|
Создание кода завершено
|
||||||
Previous IPDB and IOBJ mismatch, fall back to full compilation.
|
1 of 8 functions (12.5%) were compiled, the rest were copied from previous compilation.
|
||||||
All 8 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
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
|
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