Commit f487976c authored by lyong's avatar lyong

优化产测

parent 7013bf2f
......@@ -78,7 +78,7 @@
brightnessAutoValue = 100;
this.testTimer = this.$setInterval(this.InterValTime, 10, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestBright");
},
......@@ -117,8 +117,13 @@
this.initSatte();
this.$clearInterval(this.testTimer);
},
checkAutoFactory: function (node, topNode, x, y) {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestBright");
},
touchedYesButton: function (node, topNode, x, y) {
this.checkAutoFactory();
if (globalThis.factoryTest.autoStart == 1)
return;
globalThis.factoryTest.bright = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestBright);")
......
......@@ -2,7 +2,7 @@
<div class="screen" onpress="onChildLockPress" onrelease="onChildLockRelease">
<div style="left:0;top:0;width:480;height:30; background-color:rgb(0, 0, 0);" id="tipDiv">
<text class="fontsize22Left" style="left:1;top: 0;text-align: center ;width: 240;height:30;background-color:rgb(224, 76, 12);">长按重启</text>
<text class="fontsize22Left" style="left:1;top: 0;text-align: center ;width: 240;height:30;background-color:rgb(224, 76, 12);">{{warnText}}</text>
<div style="left:240;top: 0;text-align: left;width: 240;height:30;background-color:#FFFFFF; opacity: 0.7;">
<div class="yLine" style="left:0;background-color:#000000;"></div>
<text class="fontsize22Left" style="left:3;top: 0;text-align: left;width: 80;color: #000000; ">{{crtMousemoveX}}</text>
......@@ -82,19 +82,21 @@
crtMemoryAvailable: "NA",
crtMemorycrtMemtester: "NA",
crtMousemoveX: "X:",
crtMousemoveY: "Y:"
crtMousemoveY: "Y:",
warnText: "长按退出"
},
/*************** struct ***************/
onInit: function () {
//this.$setImageForceUpdate(true);
this.eventOk = 0;
},
onShow: function () {
this.$enableMouseMoveEvent(true);
//console.log(this.$uri + "===========onShow=============")
factory_testBurnIn.initFactoryTestBurnIn(this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestBurnIn");
},
onHide: function () {
//console.log(this.$uri + "===========onHide=============")
......@@ -149,22 +151,32 @@
onChildLockRelease: function (node, topNode, x, y) {
document.stopLongPress();
if (this.eventOk == 1) {
this.longPreeEvent();
}
this.eventOk = 0;
this.warnText = "长按退出"
},
onChildLockPress: function (node, topNode, x, y) {
var that = this;
document.startLongPress(function () {
//userData.childLockSwitchFlag = 0;
that.quitEvent();
// userData.childLockSwitchFlag = 0;
that.eventOk = 1;
that.warnText = "松手退出"
//that.proxy.setChildLock(userData.childLockSwitchFlag);
}, 2000);
},
longPreeEvent: function () {
this.quitEvent();
setTimeout(function () {
router.push({
path: "factory_testList"
});
//that.proxy.setChildLock(userData.childLockSwitchFlag);
}, 3000);
}, 1000);
},
/*************** gesture ***************/
onGestureEvent: function (dir, x, y) {
//console.log(dir + " " + x + " " + y);
......@@ -284,6 +296,7 @@
color: #FFFFFF;
background-color: transparent;
}
.fontsize16 {
width: 120;
height: 30;
......@@ -293,6 +306,7 @@
color: #FFFFFF;
background-color: transparent;
}
.fontsize18 {
top: 90;
width: 200;
......
......@@ -20,7 +20,6 @@
<script>
var router = require("@system.router");
var lvgl = require("@native.lvgl7");
var factory_testAtuo = require("factory_testAtuo.js");
export default {
data: {
colorBash: [
......@@ -77,8 +76,6 @@
this.checkFlagBash(this.imgCnt)
this.imgCnt++
require("factory_testAtuo.js").atuoFactoryTest("factoryTestColor");
},
onHide: function () {
//console.log(this.$uri + "===========onHide=============")
......@@ -123,11 +120,15 @@
this.$show("id_yes")
this.$show("id_ng")
this.$show("id_back")
this.checkAutoFactory();
}
}
}
},
checkAutoFactory: function () {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestColor");
},
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.color = 1
......
......@@ -63,8 +63,7 @@
// wifiEventJS.connect_wifi(initWifissid, initWifipwd);
// wifiEventJS.enableWLANSwitch();
// this.testTimer = this.$setTimeout(this.InterValTime, 5000, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestLicenseAuthor");
this.checkLisense();
},
onHide: function () {
......@@ -98,7 +97,10 @@
});
},
touchedstartTestButton: function (node, topNode, x, y) {
this.checkLisense();
},
checkLisense: function () {
const fs = require("@system.fs")
var filenm = "operation_license"
var partFilePath = "../../../../../mnt/extsd/msdkFiles/" + filenm
......@@ -106,16 +108,16 @@
this.crtBrightnessValue = "已注册!"
//console.log("the " + filenm + " is exists.")
this.$setY("id_yes", 0);
return 0
this.checkAutoFactory();
return;
}
// //console.log("the " + filenm + " is exists.")
this.crtBrightnessValue = "未注册"
},
checkAutoFactory: function (node, topNode, x, y) {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestLicenseAuthor");
},
movePage: function (oldPage, newPage) {
//console.log(oldPage + "==========to==========" + newPage);
this.$hide(oldPage); // 跳转页面之前立即关掉toast
......
......@@ -12,11 +12,13 @@
<!-- <div style="left:0;top:180;width:480;height:80; background-color:#000000 " id="tipDiv" > -->
<text class="fontsize24" id="id_crtLocalTime" style="left:0;top: 80;text-align: center ;width: 480;height:80;">{{crtLocalTime}}</text>
<!-- </div> -->
<text class="fontsize40" id="id_crtTextRtcText" style="left:0;top: 160;text-align: center ;width: 480;height:80;">{{crtTextRtcText}}</text>
</div>
<div style="left:25;top: 366;width: 460;height: 96; background-color: transparent;">
<div style="left:80;top: 366;width: 460;height: 96; background-color: transparent;">
<div style="left:0 ; width: 100;height: 96;background-color: #858282;">
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton" style="color: #000000; top: 15;">back</text>
</div>
......@@ -27,7 +29,7 @@
<text class="testReturn" id="id_startTest" onpress="touchedScreen" onclick="touchedstartTestButton" style="color: #000000;top: 0;left: 0; ">开始测试</text>
</div> -->
<div id="id_yes" style=" left:330 ;top: -480; width: 100;height: 96;background-color: #FF9700;">
<div id="id_yes" style=" left:220 ;top: -480; width: 100;height: 96;background-color: #FF9700;">
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton" style="color: #000000;top: 15;left: 0; ">PASS</text>
</div>
......@@ -42,6 +44,7 @@
export default {
data: {
crtLocalTime: "NA",
crtTextRtcText: "NA",
imgCnt: 0,
pngCnt: 0,
gifIconSrc: "",
......@@ -55,7 +58,6 @@
//console.log(this.$uri + "===========onShow=============")
factory_testRtc.factoryTestRTCInit(this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestRtc");
},
onHide: function () {
factory_testRtc.exitTestRTC();
......@@ -70,7 +72,7 @@
globalThis.factoryTest.rtc = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestSound);")
yesJumpPage.yesGoToNextPage("factoryTestBurnIn");
yesJumpPage.yesGoToNextPage("factoryTestRtc");
},
touchedNGButton: function (node, topNode, x, y) {
globalThis.factoryTest.rtc = 2;
......
......@@ -11,9 +11,9 @@
<!-- <div style="left:140 ; top:120 ;width: 200;height: 96;background-color: #99D0F7"> -->
<text class="testReturn" id="brightnessValueText" style="top: 200;color: rgb(246, 250, 3);text-align: center;width: 480;">{{crtBrightnessValue}}</text>
<text class="testReturn" id="brightnessValueText" style="top: 200;color: rgb(246, 250, 3);text-align: center;width: 480;">{{crtBrightnessValue}}</text>
<!-- </div> -->
......@@ -56,13 +56,13 @@
onShow: function () {
this.$setY("id_yes", -480);
// this.crtBrightnessValue = "点击开始测试播放";
// this.$hide("id_yes");
// document.setAttribute('id_enableWLANPageList', 'list-set-edge-flash', false);
// wifiEventJS.connect_wifi(initWifissid, initWifipwd);
// wifiEventJS.enableWLANSwitch();
// this.testTimer = this.$setTimeout(this.InterValTime, 5000, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestSound");
},
......@@ -80,8 +80,12 @@
},
touchedYesButton: function (node, topNode, x, y) {
this.checkAutoFactory();
if (globalThis.factoryTest.autoStart == 1)
return;
globalThis.factoryTest.sound = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
var yesJumpPage = require("factoryYesJumpPage.js");
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestSound);")
yesJumpPage.yesGoToNextPage("factoryTestSound");
},
......@@ -98,16 +102,20 @@
},
touchedstartTestButton: function (node, topNode, x, y) {
var soundLevelText = "tinymix set 16 " + 7
// systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/eAplay.sh /mnt/app/voice_click.wav");
systemCtrl.executeSystemCommand(soundLevelText);
systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/eAplay.sh /mnt/app/voice_click.wav");
this.crtBrightnessValue = "播放结束,点击开始测试重复播放";
this.$setY("id_yes",0);
},
this.$setY("id_yes", 0);
// this.checkAutoFactory();
},
checkAutoFactory: function (node, topNode, x, y) {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestSound");
},
movePage: function (oldPage, newPage) {
//console.log(oldPage + "==========to==========" + newPage);
this.$hide(oldPage); // 跳转页面之前立即关掉toast
......@@ -116,7 +124,7 @@
this.$setY(newPage, 0); // show
},
};
</script>
<style>
......@@ -125,6 +133,7 @@
left: 0;
width: 480;
height: 480;
background-color: #A8A8A8;
/* color: black; */
}
......
......@@ -206,7 +206,6 @@
}
this.dataInit();
require("factory_testAtuo.js").atuoFactoryTest("factoryTestTouch");
// this.$enableMouseMoveEvent(true);
},
exitEvent: function () {
......@@ -398,9 +397,13 @@
this.$setY("id_yes", 384);
this.checkAutoFactory();
// this.$setY("id_ng", 256);
// this.$setY("id_back", 384);
},
checkAutoFactory: function (node, topNode, x, y) {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestTouch");
},
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.touch = 1;
......
......@@ -32,7 +32,7 @@
</div>
<!-- test -->
<!-- <div id="id_yes" style=" left:220 ;top: 0; width: 100;height: 96;background-color: #FF9700;"> -->
<div id="id_yes" style=" left:330 ;top: -480; width: 100;height: 96;background-color: #FF9700;">
<div id="id_yes" style=" left:220 ;top: -480; width: 100;height: 96;background-color: #FF9700;">
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton" style="color: #000000;top: 15;left: 0; ">PASS</text>
</div>
</div>
......@@ -67,8 +67,12 @@
this.recvCommValueText = "" + userData.factoryRecvCnt;
if (userData.factoryRecvCnt > 0) {
this.$setY("id_yes", 0);
this.checkAutoFactory();
}
},
checkAutoFactory: function (node, topNode, x, y) {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestUartComm");
},
uartComm: function () {
var serialPortName = undefined
// var serialManager = require("serialmanager.js");
......@@ -88,11 +92,10 @@
}
},
onShow: function () {
this.$setY("id_yes", -480);
this.uartComm();
this.testTimer = this.$setInterval(this.InterValTime, 2000, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestUartComm");
},
onHide: function () {
......
......@@ -1088,7 +1088,7 @@
];
},
updateMainConnectWifiShowUI: function () {
this.$setY("id_hide", 0)
var wifiInfo = wifiEventJS.getWifiInfo(this.initWifissid);
if (wifiInfo) {
......@@ -1108,8 +1108,9 @@
if (wifiInfo.isConnected) {
if (wifiInfo.signalLevel > -38) {
console.log("okok");
this.$setY("id_yes", 0);
this.wifiInfoState_TEXT = "WIFI测试成功"
this.$setY("id_yes", 0);
this.checkAutoFactory();
return;
} else {
console.log("no");
......@@ -1128,7 +1129,9 @@
}
this.wifiInfoState_TEXT = "WIFI测试失败"
},
checkAutoFactory: function (node, topNode, x, y) {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestWifi");
},
InterValTime: function () {
console.log("=========================InterValTime====================");
// wifiEventJS.connect_wifi(this.initWifissid, this.initWifipwd, this.initencryptedMode);
......@@ -1163,7 +1166,6 @@
this.refreshTimeFormatFlag(this.timeFormatFlag);
this.refreshTimeValue();
require("factory_testAtuo.js").atuoFactoryTest("factoryTestWifi");
},
onReady: function () {
......@@ -1269,6 +1271,7 @@
touchedStartScanWifiButton: function (node, topNode, x, y) {
console.log("touchedStartScanWifiButton");
console.log("====================================================");
this.$setY("id_yes", -480);
this.goToConnectWifi();
},
preInitMainConnectWifiShowUI: function () {
......
......@@ -132,7 +132,7 @@
top: 190,
left: 20,
en: 1,
index: 9,
index: 0,
},
{
id: "id_factoryTestsystemCheck",
......@@ -141,7 +141,7 @@
top: 370,
left: 20,
en: 1,
index: 0,
index: 9,
},
{
id: "id_factoryTestClearAll",
......@@ -227,7 +227,6 @@
yesJumpPage.initPage(this.appItem);
yesJumpPage.testCode(this)
require("factory_testAtuo.js").initMianPage(this);
},
initShow: function () {
......@@ -277,6 +276,12 @@
this.initShow();
this.burnInEvent();
},
burnInEvent: function () {
require("factory_testBurnIn.js").exStopagainMp4(); //从老测测试退出重新执行一次退出视频,防止卡图层
},
restoreFactoryTestValues: function (obj) {
......@@ -340,11 +345,11 @@
}
if (url == "factoryTestStart") {
//console.log("==============factoryTestStart================");
globalThis.factoryTest.atuoStart = 1;
globalThis.factoryTest.autoStart = 1;
url = "factoryTestColor";
}
else{
globalThis.factoryTest.atuoStart = 2;
globalThis.factoryTest.autoStart = 2;
}
if (url == "factoryTestExit") {
var systemCtrl = require("systemCtrl.js");
......
var _userdata = require("userdata.js");
var userData = _userdata.userData;
const fs = require("@system.fs");
var systemCtrl = require("systemCtrl.js");
var lvgl = require("@native.lvgl7");
var id_testRtcTimer = null;
var that;
var thatList
var jumpPageName;
var id_testAtuoTimer;
// globalThis.factoryTest.color = 0;
// globalThis.factoryTest.touch = 0;
// globalThis.factoryTest.wifi = 0;
// globalThis.factoryTest.sound = 0;
// globalThis.factoryTest.uartComm = 0;
// globalThis.factoryTest.bright = 0;
// globalThis.factoryTest.licenseAuthor = 0;
// globalThis.factoryTest.rtc = 0;
// globalThis.factoryTest.burnIn = 0;
// globalThis.factoryTest.systemCheck = 0;
var flageMap = {
"factoryTestColor": "color",
"factoryTestTouch": "touch",
"factoryTestWifi": "wifi",
"factoryTestSound": "sound",
"factoryTestUartComm": "uartComm",
"factoryTestBright": "bright",
"factoryTestLicenseAuthor": "licenseAuthor",
"factoryTestRtc": "rtc",
"factoryTestBurnIn": "burnIn",
"factoryTestsystemCheck": "systemCheck",
"factoryTestClearAll": "clearAll",
"factoryTestStart": "start",
"factoryTestExit": "exit"
};
function autoTestCheck() {
// 获取当前页面名称
var currentTest = getCurrentTestName();
if (currentTest) {
// 检查当前测试是否完成
//console.log("!!Current test: " + globalThis.factoryTest[flageMap[currentTest]]);
if (globalThis.factoryTest[flageMap[currentTest]] === 1) {
// 获取下一个测试页面名称
var nextTest = getNextTest(currentTest);
//console.log("!!Next test: " + nextTest);
if (nextTest) {
// 跳转到下一个测试页面
router.push({
path: nextTest,
});
//console.log("Auto jumping to: " + nextTest);
}
}
}
}
function getNextTest(currentTest) {
// 获取当前测试项的索引
var currentIndex = thatList.appItem.findIndex(item => item.startup === currentTest);
//console.log("currentIndex: " + currentIndex);
if (currentIndex !== -1) {
// 获取下一个测试项
var nextIndex = (currentIndex + 1) % thatList.appItem.length;
//console.log("nextIndex: " + nextIndex);
return thatList.appItem[nextIndex].startup;
}
return null;
}
function atuoFactoryTest( pageName) {
// jumpPageName = pageName;
// // 启动定时器,每5秒检查一次测试状态并跳转
// if (id_testAtuoTimer != null) {
// clearInterval(id_testAtuoTimer);
// id_testAtuoTimer == null;
// }
// id_testAtuoTimer = setInterval(() => {
// autoTestCheck();
// }, 2000);
}
function getCurrentTestName() {
// 获取当前页面名称,这里假设有一个方法可以获取当前页面名称
// 例如,可以通过路由信息获取
return jumpPageName; // 假设 this.$route.path 返回当前页面路径
}
function initMianPage(obj) {
//console.log("!!!!!!!!initMianPage!!!!!!!!");
thatList = obj;
}
module.exports = {
atuoFactoryTest: atuoFactoryTest,
initMianPage: initMianPage
}
\ No newline at end of file
var _userdata = require("userdata.js");
var userData = _userdata.userData;
const fs = require("@system.fs");
var systemCtrl = require("systemCtrl.js");
var lvgl = require("@native.lvgl7");
var router = require("@system.router");
var id_testRtcTimer = null;
var that;
var thatList
var flageMap = {
"factoryTestColor": "color",
"factoryTestTouch": "touch",
"factoryTestWifi": "wifi",
"factoryTestSound": "sound",
"factoryTestUartComm": "uartComm",
"factoryTestBright": "bright",
"factoryTestLicenseAuthor": "licenseAuthor",
"factoryTestRtc": "rtc",
"factoryTestBurnIn": "burnIn",
"factoryTestsystemCheck": "systemCheck",
"factoryTestClearAll": "clearAll",
"factoryTestStart": "start",
"factoryTestExit": "exit"
};
var autoMovePage = [
"factoryTestColor",
"factoryTestTouch",
"factoryTestWifi",
"factoryTestSound",
"factoryTestUartComm",
"factoryTestBright",
"factoryTestLicenseAuthor",
"factoryTestRtc",
// "factoryTestBurnIn",
"factoryTestsystemCheck",
// "factoryTestClearAll",
// "factoryTestStart"
];
var exitNextPage = "factory_testList";
// ✅ 获取下一个测试页面
function getNextTest(currentTest) {
var index = autoMovePage.indexOf(currentTest);
if (index !== -1 && index < autoMovePage.length - 1) {
return autoMovePage[index + 1];
}
return null; // 最后一个页面无下一页
}
function autoFactoryNextPage(curPageName) {
console.log("---------------");
if (!curPageName) return;
console.log("[autoFactoryNextPage] 当前页面:" + curPageName);
console.log("[autoFactoryNextPage] autoStart状态:" + globalThis.factoryTest.autoStart);
if (globalThis.factoryTest.autoStart == 1) {
// if (1) {
var testKey = flageMap[curPageName];
if (!testKey) {
console.warn("[autoFactoryNextPage] 未映射的页面:" + curPageName);
return;
}
globalThis.factoryTest[testKey] = 1;
if (globalThis.factoryTest[testKey] === 1) {
var nextPage = getNextTest(curPageName);
if (nextPage) {
console.log("[autoFactoryNextPage] 自动跳转到:" + nextPage);
router.push({ path: nextPage });
} else {
console.log("[autoFactoryNextPage] 已到达最后一页,跳转结束。");
globalThis.factoryTest.autoStart = 0; // 可选:停止自动流程
router.push({ path: exitNextPage });
}
} else {
console.log("[autoFactoryNextPage] 当前测试未完成,不跳转。");
}
}
}
module.exports = {
autoFactoryNextPage: autoFactoryNextPage,
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ var lvgl = require("@native.lvgl7");
var id_testBurnInTimer = null;
var that;
var strMemtesterCnt = 0; // 初始化测试掩码计数器
var exStopagainMp4Flag = false;
// 测试掩码映射表
const testMaskMap = {
"0x1": "Compare XOR",
......@@ -27,7 +28,7 @@ const testMaskMap = {
"0x8000": "16-bit Writes"
};
function system(str) {
systemCtrl.executeSystemCommand(str);
system(str);
}
function initFactoryTestBurnIn(obj) {
that = obj;
......@@ -50,45 +51,87 @@ function initFactoryTestBurnIn(obj) {
// }, 20000);
}
function quitFactoryTestBurnIn() {
exitMp4();
system("killall -9 memtester 2>/dev/null")
//console.log("quitFactoryTestBurnIn");
if (id_testBurnInTimer != null) {
clearInterval(id_testBurnInTimer);
id_testBurnInTimer == null;
}
exitMp4();
}
function system(com) {
systemCtrl.executeSystemCommand(com)
}
var id_mp4Timer = null;
var id_mp4exitTimer = null;
function startMp4() {
// lvgl.lv_set_screen_transparent(true);
systemCtrl.executeSystemCommand("tplayerdemo /mnt/app/quicknode/tests/re860_factory/images/factory/testVideo240p.mp4 &");
if (id_mp4Timer != null) {
clearInterval(id_mp4Timer);
id_mp4Timer == null;
}
// router.push({
// path: "factoryTestBurnIn"
// });
id_mp4Timer = setTimeout(() => {
// lvgl.lv_set_screen_transparent(true);
system("tplayerdemo /mnt/app/quicknode/tests/re860_factory/images/factory/testVideo240p.mp4 > /dev/null 2>&1 &");
}, 200);
}
function exitMp4() {
// systemCtrl.executeSystemCommand("quit");
systemCtrl.executeSystemCommand("killall -9 tplayerdemo &");
// systemCtrl.executeSystemCommand("dd if=/dev/zero of=/dev/fb0");
// system("dd if=/dev/zero of=/dev/fb0");
systemCtrl.executeSystemCommand("quit");
// systemCtrl.executeSystemCommand("killall -9 tplayerdemo");
// setTimeout(() => {
systemCtrl.executeSystemCommand("tplayerdemo");
// console.log("!!!!!!!!!quitMp4 1");
systemCtrl.executeSystemCommand("quit");
// console.log("!!!!!!!!!quitMp4 2");
systemCtrl.executeSystemCommand("killall -9 tplayerdemo &");
// console.log("!!!!!!!!!quitMp4 3");
// }, 1000);
// if (id_mp4exitTimer != null) {
// clearInterval(id_mp4exitTimer);
// id_mp4exitTimer == null;
// }
// id_mp4exitTimer = setTimeout(() => {
// lvgl.lv_set_screen_transparent(false);
systemCtrl.executeSystemCommand("reboot 1");
systemCtrl.executeSystemCommand("quit");
// 1. 温和退出
system("killall -2 tplayerdemo 2>/dev/null");
setTimeout(() => {
// 2. 空跑一次 tplayerdemo(静默后台)
system("tplayerdemo > /dev/null 2>&1 &");
// 3. 马上再杀掉
setTimeout(() => {
system("killall -9 tplayerdemo 2>/dev/null");
}, 100); // 100 ms 足够让进程起来
}, 200); // 200 ms 给第一次退出留时间
// }, 500);
exStopagainMp4Start();
}
function exStopagainMp4Start() {
exStopagainMp4Flag = true;
}
function exStopagainMp4Stop() {
exStopagainMp4Flag = false;
}
function exStopagainMp4() {
if (exStopagainMp4Flag == true) {
system("killall -2 tplayerdemo 2>/dev/null");
setTimeout(() => {
// 2. 空跑一次 tplayerdemo(静默后台)
system("tplayerdemo > /dev/null 2>&1 &");
// 3. 马上再杀掉
setTimeout(() => {
system("killall -9 tplayerdemo 2>/dev/null");
}, 100); // 100 ms 足够让进程起来
}, 200); // 200 ms 给第一次退出留时间
exStopagainMp4Stop();
}
}
function setTextColorById(that, id, value) {
const color = (value === "NA") ? "#ff0000" : "#00ff00";
that.$setTextColor(id, color);
......@@ -98,10 +141,10 @@ var testMask = 0x1;
var commFlag = 1;
function setTextColorByMemtester(){
// 0 = 绿色,1 = 红色
const memColor = that.crtMemorycrtMemtester.includes(': OK') ? '#00ff00' : '#ff0000';
that.$setTextColor('id_crtMemorycrtMemtester', memColor);
function setTextColorByMemtester() {
// 0 = 绿色,1 = 红色
const memColor = that.crtMemorycrtMemtester.includes(': OK') ? '#00ff00' : '#ff0000';
that.$setTextColor('id_crtMemorycrtMemtester', memColor);
}
function updateBurnInInfo() {
that.crtCPUModel = getCPUModel();
......@@ -410,6 +453,7 @@ function getDiskInfo() {
module.exports = {
initFactoryTestBurnIn: initFactoryTestBurnIn,
quitFactoryTestBurnIn: quitFactoryTestBurnIn
quitFactoryTestBurnIn: quitFactoryTestBurnIn,
exStopagainMp4: exStopagainMp4,
}
\ No newline at end of file
......@@ -7,15 +7,15 @@ var lvgl = require("@native.lvgl7");
var id_testRtcTimer = null;
var that;
var rtcCtl = require("factory_rtc.js");
var cntTime = 0;
var cntSuccess = 0;
function system(str) {
systemCtrl.executeSystemCommand(str);
}
function exitTestRTC(){
if (id_testRtcTimer != null) {
function exitTestRTC() {
if (id_testRtcTimer != null) {
clearInterval(id_testRtcTimer);
id_testRtcTimer == null;
}
......@@ -26,18 +26,33 @@ function factoryTestRTCInit(obj) {
if (id_testRtcTimer != null) {
clearInterval(id_testRtcTimer);
id_testRtcTimer == null;
cntTime = 0;
cntSuccess = 0;
}
updateRtcInfo();
id_testRtcTimer = setInterval(() => {
cntTime += 1;
updateRtcInfo();
}, 5000);
}, 1000);
}
function setTextColorById(that, id, value) {
const color = (value === "NA") ? "#ff0000" : "#00ff00";
that.$setTextColor(id, color);
}
function setTextColorByText(that, id, value) {
var color;
if (value === "测试失败") {
color = "#ff0000";
}
else if (value === "检测中...") {
color = "#ff8400";
}
else {
color = "#00ff00";
}
that.$setTextColor(id, color);
}
var testCnt = 3
function updateRtcInfo() {
var rtc = getRtcTime();
that.crtLocalTime = rtc;
......@@ -47,17 +62,44 @@ function updateRtcInfo() {
setTextColorById(that, 'id_crtLocalTime', that.crtLocalTime);
var values = [that.crtLocalTime];
var allValuesValid = values.every(value => value !== "NA");
console.log("allValuesValid:" + allValuesValid);
// 根据检查结果设置烧录测试状态
globalThis.factoryTest.rtc = allValuesValid ? 1 : 2;
var Yval = allValuesValid == 1 ? 0 : -480
that.$setY("id_yes",Yval)
}
console.log(`[RTC] 第 ${cntTime} 次检测,状态:${allValuesValid == true ? "有效" : "无效"}`);
if (allValuesValid == 1) {
cntSuccess += 1;
} else {
cntSuccess = 0;
}
if (cntTime < testCnt) {
that.crtTextRtcText = "检测中...";
setTextColorByText(that, 'id_crtTextRtcText', that.crtTextRtcText);
that.$setY("id_yes", -480);
return; // 不继续判断
}
// 第2次检测完成,设置最终结果
that.crtTextRtcText = cntSuccess > testCnt ? "测试通过" : "测试失败";
setTextColorByText(that, 'id_crtTextRtcText', that.crtTextRtcText);
globalThis.factoryTest.rtc = cntSuccess > testCnt ? 1 : 2;
that.$setY("id_yes", cntSuccess > testCnt ? 0 : -480);
console.log("[RTC] 测试完成,最终状态:" + (cntSuccess > testCnt ? "通过" : "失败"));
// cntTime = 0;
// 可选:停止定时器
// exitTestRTC();
checkAutoFactory();
}
function checkAutoFactory() {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestRtc");
}
function getRtcTime() {
system("hwclock > /tmp/hwRtc.txt");
......
var systemCtrl = require("systemCtrl.js");
var cilckFlag = 0;
function disCilck() {
system("echo 0 > /sys/devices/platform/soc@3000000/2502800.twi/i2c-2/2-0014/vib")
cilckFlag = 1;
}
function onCilck() {
system("echo 1 > /sys/devices/platform/soc@3000000/2502800.twi/i2c-2/2-0014/vib")
}
function checklongPressCilck() {
console.log("------checklongPressCilck----");
if (cilckFlag == 0) {
onCilck();
}
else if (cilckFlag == 1) {
cilckFlag = 0;
}
}
function system(com) {
systemCtrl.executeSystemCommand(com)
}
module.exports = {
disCilck: disCilck,
onCilck: onCilck,
checklongPressCilck: checklongPressCilck,
}
\ 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