فهرست منبع

保持重启指令

vothin 1 سال پیش
والد
کامیت
a291f37d6a
3فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 10 3
      jni/logic/mainLogic.cc
  2. BIN
      libs/armeabi/libzkgui.so
  3. BIN
      obj/activity/mainActivity.o

+ 10 - 3
jni/logic/mainLogic.cc

@@ -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;

BIN
libs/armeabi/libzkgui.so


BIN
obj/activity/mainActivity.o