Preview error handle.5
This commit is contained in:
@@ -27,20 +27,26 @@ volatile int running = 1;
|
||||
volatile int progress = 0;
|
||||
volatile int status = READY;
|
||||
volatile int stop_flag = 0;
|
||||
volatile int empty = 0;
|
||||
char output_path[256] = {0};
|
||||
|
||||
void ThreadFunc(void* args){
|
||||
while (running){
|
||||
WaitForSingleObject(e1, INFINITE);
|
||||
status = SCANNING;
|
||||
stop_flag = 0;
|
||||
progress = 0;
|
||||
for (int i = 0; i <= 50; ++i) {
|
||||
if (stop_flag > 0){
|
||||
stop_flag = 0;
|
||||
break;
|
||||
}
|
||||
progress = 0;
|
||||
WaitForSingleObject(e1, INFINITE);
|
||||
|
||||
status = SCANNING;
|
||||
Sleep(300);
|
||||
if (empty)
|
||||
{
|
||||
GetPreviewData();
|
||||
}
|
||||
for (int i = 0; i <= 50; ++i) {
|
||||
if (stop_flag > 0 || status != SCANNING){
|
||||
stop_flag = 0;
|
||||
break;
|
||||
}
|
||||
if (i == 20){
|
||||
progress = 139;
|
||||
WaitForSingleObject(e2, INFINITE);
|
||||
@@ -53,6 +59,10 @@ void ThreadFunc(void* args){
|
||||
}
|
||||
else{
|
||||
progress = i *2;
|
||||
}
|
||||
if (stop_flag > 0 || status != SCANNING){
|
||||
stop_flag = 0;
|
||||
break;
|
||||
}
|
||||
Sleep(300);
|
||||
}
|
||||
@@ -107,7 +117,8 @@ StatusInfo GetStatus() {
|
||||
}
|
||||
|
||||
//result, 0 success, other false
|
||||
int SetScanInfo(const char* jsonString, int empty) {
|
||||
int SetScanInfo(const char* jsonString, int e) {
|
||||
empty = e;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user