|
@@ -294,6 +294,7 @@ void CUB530View::OnInitialUpdate()
|
|
|
// // 创建截图线程;
|
|
|
// std::thread t(CaptureImageThread, this);
|
|
|
// t.detach();
|
|
|
+ SetTimer(1, 5000, NULL);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -921,6 +922,25 @@ void CUB530View::OnTimer(UINT_PTR nIDEvent)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ else if (nIDEvent == 1)
|
|
|
+ {
|
|
|
+ // 自动重连处理;
|
|
|
+ // 1、等待线程完成截图? 如果已经处于卡死状态下,不好!
|
|
|
+ if ( Global::g_Config.bAutoReconnect )
|
|
|
+ {
|
|
|
+ static CTime lastTime = CTime::GetCurrentTime();
|
|
|
+ CTime curTime = CTime::GetCurrentTime();
|
|
|
+ if ((curTime - lastTime).GetMinutes() >= Global::g_Config.nReconnectCycle)
|
|
|
+ {
|
|
|
+ HwUninitialize();
|
|
|
+ HwInitialize();
|
|
|
+
|
|
|
+ // 重置时间;
|
|
|
+ lastTime = CTime::GetCurrentTime();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
CView::OnTimer(nIDEvent);
|
|
|
}
|