Commit 675b8055 authored by lyong's avatar lyong

fix:优化rtc测试第一轮不会停止时间流逝

parent 19128819
......@@ -74,8 +74,11 @@
require("factory_testAuto.js").autoFactoryNextPage("factoryTestRtc");
},
exit: function () {
factory_testRtc.exitTestRTC();
},
touchedYesButton: function (node, topNode, x, y) {
this.exit();
this.checkAutoFactory();
var global = require("factory_dataStorage.js");
//if (globalThis.factoryTest.autoStart == 1)
......@@ -88,6 +91,7 @@
yesJumpPage.yesGoToNextPage("factoryTestRtc");
},
touchedNGButton: function (node, topNode, x, y) {
this.exit();
//globalThis.factoryTest.rtc = 2;
var global = require("factory_dataStorage.js");
global.setFactoryData("rtc", 2);
......@@ -96,7 +100,8 @@
});
},
touchedBackButton: function (node, topNode, x, y) {
// var global = require("factory_dataStorage.js");
this.exit();
// var global = require("factory_dataStorage.js");
//global.setFactoryData("rtc", 3);
router.push({
path: "factory_testList",
......
......@@ -33,6 +33,7 @@ function factoryTestRTCInit(obj) {
cntTime = 0;
cntSuccess = 0;
}
that.crtfilesLocalTime = "NA";
updateRtcInfo();
id_testRtcTimer = setInterval(() => {
cntTime += 1;
......@@ -56,6 +57,9 @@ function setTextColorByText(that, id, value) {
}
that.$setTextColor(id, color);
}
var testCnt = 3
function updateRtcInfo() {
var rtc = getRtcTime();
......@@ -72,7 +76,7 @@ function updateRtcInfo() {
console.log("allValuesValid:" + allValuesValid);
// 根据检查结果设置烧录测试状态
that.crtfilesLocalTime = "NA";
console.log(`[RTC] 第 ${cntTime} 次检测,状态:${allValuesValid == true ? "有效" : "无效"}`);
......@@ -105,7 +109,8 @@ function updateRtcInfo() {
console.log("[RTC] 时钟未前进,测试失败");
cntSuccess = 0;
var state = 0;
that.crtTextRtcText = state ? "测试通过" : "测试失败";
var text = state ? "测试通过" : "测试失败";
that.crtTextRtcText = text + ",如需RTC时间流逝测试,请重进"
setTextColorByText(that, 'id_crtTextRtcText', that.crtTextRtcText);
//globalThis.factoryTest.rtc = state ? 1 : 2;
var testVal = state ? 1 : 2;
......@@ -117,17 +122,23 @@ function updateRtcInfo() {
console.log("[RTC] 时钟已前进,继续通过流程");
system("rm -fr " + Path);
var state = 1;
that.crtTextRtcText = state ? "测试通过" : "测试失败";
var text = state ? "测试通过" : "测试失败";
that.crtTextRtcText = text + ",如需RTC时间流逝测试,请重进"
setTextColorByText(that, 'id_crtTextRtcText', that.crtTextRtcText);
//globalThis.factoryTest.rtc = state ? 1 : 2;
var testVal = state ? 1 : 2;
that.$setY("id_yes", state ? 0 : -480);
console.log("[RTC] 测试完成,最终状态:" + (state ? "通过" : "失败"));
var global = require("factory_dataStorage.js");
global.setFactoryData("rtc", 1);
}
var global = require("factory_dataStorage.js");
global.setFactoryData("rtc", testVal);
// if (testVal == 2) {
exitTestRTC();
//}
} else {
oneTest();
}
......@@ -139,7 +150,7 @@ function updateRtcInfo() {
oneTest();
}
exitTestRTC();
// exitTestRTC();
}
// that.crtTextRtcText = cntSuccess > testCnt ? "测试通过" : "测试失败";
// setTextColorByText(that, 'id_crtTextRtcText', that.crtTextRtcText);
......@@ -158,11 +169,14 @@ function updateRtcInfo() {
function oneTest() {
var iso = that.crtLocalTime;
system("echo '" + iso + "' > " + Path);
that.crtfilesLocalTime = iso;
system("echo '" + iso + "' > " + tmpPath);
system("sync");
that.crtfilesLocalTime = iso;
setTimeout(() => {
that.crtTextRtcText = "请断电重启 测试第二阶段掉电保存"
that.crtTextRtcText = "请断电重启 测试第二阶段掉电保存"
}, 300);
}
......@@ -242,7 +256,5 @@ function getRtcTime() {
module.exports = {
factoryTestRTCInit: factoryTestRTCInit,
exitTestRTC: exitTestRTC
exitTestRTC: exitTestRTC,
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment