|
@@ -508,6 +508,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
|
|
|
int restartTime = 600;
|
|
|
int restartCount = 0;
|
|
|
+int commandCount = 0;
|
|
|
/**
|
|
|
* 定时器触发函数
|
|
|
* 不建议在此函数中写耗时操作,否则将影响UI刷新
|
|
@@ -521,14 +522,20 @@ int restartCount = 0;
|
|
|
static bool onUI_Timer(int id){
|
|
|
switch (id) {
|
|
|
case 101: {
|
|
|
- restartTime -= 1;
|
|
|
+ if (commandCount > 0) {
|
|
|
+ restartTime -= 1;
|
|
|
+ }
|
|
|
std::string restartStr = "重启倒计时:" + to_string(restartTime) + " 循环次数:" + to_string(restartCount);
|
|
|
mTextView1Ptr->setText(restartStr);
|
|
|
if (restartTime == 0) {
|
|
|
lightControl("NETRESET", "1F");
|
|
|
|
|
|
- restartTime = 600;
|
|
|
- restartCount += 1;
|
|
|
+ commandCount += 1;
|
|
|
+ if (commandCount == 10) {
|
|
|
+ restartTime = 600;
|
|
|
+ restartCount += 1;
|
|
|
+ commandCount = 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
break;
|