Commit ffd6cb68 authored by lyong's avatar lyong

添加自动化测试和注释打印

parent bdd32985
......@@ -18,15 +18,13 @@ function initEventLister() {
globalThis.eventEmitter = new EventEmitter();
}
function onCreate(uri) {
// var evue = require("router.js");
// var re860_router = require("router-re860.js").router;
// re860_router.onClick = function (node, topNode, x, y) {
// console.debug('==============================onClick')
// var systemCtrl = require("systemCtrl.js");
// systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/eAplay.sh /mnt/app/voice_click.wav");
// }
// initEventLister();
var re860_router = require("router-re860.js").router;
re860_router.onClick = function (node, topNode, x, y) {
var systemCtrl = require("systemCtrl.js");
systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/eAplay.sh /mnt/app/voice_click.wav");
}
initEventLister();
globalThis.Simu = {
"En": 0,
}
......@@ -44,32 +42,23 @@ function onCreate(uri) {
initEventLister();
gc();
//console.log(showMemInfo());
var evue = require("router.js");
var router = evue.router;
// var dom = require("dom.js"); //要放在router后面,router会创建document
// var router = re860_router;
var dom = require("dom.js"); //要放在router后面,router会创建document
var router = re860_router;
var times = [];
var dom = require("dom.js"); //要放在router后面,router会创建document
if (startUrl() == undefined) {
times.push(clock());
gc();
//console.log(showMemInfo());
router.push({ 'path': uri });
times.push(clock());
//console.log(times)
gc();
//console.log(showMemInfo());
} else {
times.push(clock());
var uriObj = JSON.parse(globalThat.$uri);
//console.log(uriObj);
console.log(uriObj);
router.push(uriObj);
times.push(clock());
//console.log(times)
console.log(times);
gc();
//console.log(showMemInfo());
}
}
......
......@@ -5,22 +5,19 @@
<!-- </div> -->
<div style="left:10;top: 10;width: 460;height: 55; background-color: #99D0F7;">
<text class="fontsize40" id="title_TEXT"
style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
<text class="fontsize40" id="title_TEXT" style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
title_TEXT }}</text>
</div>
<div style="left:140 ; top:120 ;width: 200;height: 96;background-color: #99D0F7">
<text class="testReturn" id="brightnessValueText"
style="top: 15;color: rgb(43, 123, 25);text-align: center;width: 200;">{{crtBrightnessValue}}</text>
<text class="testReturn" id="brightnessValueText" style="top: 15;color: rgb(43, 123, 25);text-align: center;width: 200;">{{crtBrightnessValue}}</text>
</div>
<div style="width: 480;height: 72;top: 230;">
<!-- <image class="brightnessPng" style="left:23;top:20;" :src="lowBrightnessPngSrc"></image> -->
<div class="setBrightnessLineDivBg"></div>
<div class="setBrightnessLineShowDiv" id="id_setBrightnessLineShowDiv"></div>
<slider id="setBrightnessSlider" min="0" max="100" :value="dynamicBindBrightnessValue" onValueChanged="onBrightnessValueChanged"
onrelease="onBrightnessValueRelease">
<slider id="setBrightnessSlider" min="0" max="100" :value="dynamicBindBrightnessValue" onValueChanged="onBrightnessValueChanged" onrelease="onBrightnessValueRelease">
</slider>
<!-- <image class="brightnessPng" style="left:425;top:20;" :src="highBrightnessPngSrc"></image> -->
</div>
......@@ -32,16 +29,13 @@
<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>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton" style="color: #000000; top: 15;">back</text>
</div>
<div style="left:110 ; width: 100;height: 96;background-color: #858282;">
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton"
style="color: #F44236;top: 15;">NG</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton" style="color: #F44236;top: 15;">NG</text>
</div>
<div style="left:220 ; width: 100;height: 96;background-color: #FF9700;">
<text class="testReturn" id="id_yes" onpress="touchedScreen" onclick="touchedYesButton"
style="color: #000000;top: 15;left: 0; ">PASS</text>
<text class="testReturn" id="id_yes" onpress="touchedScreen" onclick="touchedYesButton" style="color: #000000;top: 15;left: 0; ">PASS</text>
</div>
</div>
......@@ -59,7 +53,7 @@
var flage = 0;
export default {
data: {
dynamicBindBrightnessValue:100,
dynamicBindBrightnessValue: 100,
title_TEXT: "屏背光",
crtBrightnessValue: "",
},
......@@ -81,24 +75,26 @@
// document.setAttribute('id_enableWLANPageList', 'list-set-edge-flash', false);
// wifiEventJS.connect_wifi(initWifissid, initWifipwd);
// wifiEventJS.enableWLANSwitch();
brightnessAutoValue = 100;
this.testTimer = this.$setInterval (this.InterValTime, 10, [], this);
brightnessAutoValue = 100;
this.testTimer = this.$setInterval(this.InterValTime, 10, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestBright");
},
InterValTime: function () {
//console.log("brightnessAutoValue=" + brightnessAutoValue);
if(brightnessAutoValue == 100){
//console.log("brightnessAutoValue=" + brightnessAutoValue);
if (brightnessAutoValue == 100) {
flage = 0
}
else if(brightnessAutoValue == 0){
else if (brightnessAutoValue == 0) {
flage = 1
}
if(flage == 1){
brightnessAutoValue ++;
}else{
brightnessAutoValue --;
if (flage == 1) {
brightnessAutoValue++;
} else {
brightnessAutoValue--;
}
this.dynamicBindBrightnessValue = brightnessAutoValue;
......@@ -266,7 +262,8 @@
text-overflow: ellipsis;
font-size: 44;
}
.ValueText {
.ValueText {
position: absolute;
width: 480;
height: 34;
......
......@@ -94,6 +94,7 @@
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=============")
......
......@@ -9,12 +9,9 @@
<text class="testReturn" id="id_yes" onpress="touchedScreen" onclick="touchedYesButton"
style="top: 300;left:364;color: #000000;background-color: #FF9700;">PASS</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton"
style="top: 300;left:14 ;color: #F44236;background-color: #858282;">NG</text>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton"
style="top: 300;left:189;color: #000000;background-color: #858282;">back</text>
<text class="testReturn" id="id_yes" onpress="touchedScreen" onclick="touchedYesButton" style="top: 300;left:364;color: #000000;background-color: #FF9700;">PASS</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton" style="top: 300;left:14 ;color: #F44236;background-color: #858282;">NG</text>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton" style="top: 300;left:189;color: #000000;background-color: #858282;">back</text>
</div>
......@@ -23,6 +20,7 @@
<script>
var router = require("@system.router");
var lvgl = require("@native.lvgl7");
var factory_testAtuo = require("factory_testAtuo.js");
export default {
data: {
colorBash: [
......@@ -78,6 +76,9 @@
this.pngCnt = 0
this.checkFlagBash(this.imgCnt)
this.imgCnt++
require("factory_testAtuo.js").atuoFactoryTest("factoryTestColor");
},
onHide: function () {
//console.log(this.$uri + "===========onHide=============")
......@@ -130,9 +131,9 @@
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.color = 1
// router.push({
// router.push({
// path: "factory_testList"
// }
// }
var yesJumpPage = require("factoryYesJumpPage.js");
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestColor);")
yesJumpPage.yesGoToNextPage("factoryTestColor");
......@@ -218,28 +219,27 @@
}
#id_yes {
bottom: 20px;
left: 20px;
}
#id_yes {
bottom: 20px;
left: 20px;
}
#id_ng {
bottom: 20px;
right: 20px;
}
#id_ng {
bottom: 20px;
right: 20px;
}
#id_back {
bottom: 20px;
right: 20px;
}
#id_back {
bottom: 20px;
right: 20px;
}
.testReturn {
position: absolute;
width: 96;
height: 64;
text-align: center;
text-overflow: ellipsis;
font-size: 44;
}
position: absolute;
width: 96;
height: 64;
text-align: center;
text-overflow: ellipsis;
font-size: 44;
}
</style>
\ No newline at end of file
......@@ -5,15 +5,13 @@
<!-- </div> -->
<div style="left:20;top: 10;width: 440;height: 55; background-color: #99D0F7;">
<text class="fontsize40" id="title_TEXT"
style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
<text class="fontsize40" id="title_TEXT" style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
title_TEXT }}</text>
</div>
<!-- <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> -->
......@@ -22,24 +20,20 @@
<div style="left:25;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>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton" style="color: #000000; top: 15;">back</text>
</div>
<div style="left:110 ; width: 100;height: 96;background-color: #858282;">
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton"
style="color: #F44236;top: 15;">NG</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton" style="color: #F44236;top: 15;">NG</text>
</div>
<div style="left:220 ; width: 100;height: 96;background-color: #FF9700;">
<text class="testReturn" id="id_startTest" onpress="touchedScreen" onclick="touchedstartTestButton"
style="color: #000000;top: 0;left: 0; ">开始测试</text>
<text class="testReturn" id="id_startTest" onpress="touchedScreen" onclick="touchedstartTestButton" style="color: #000000;top: 0;left: 0; ">开始测试</text>
</div>
<!-- test -->
<!-- <div id="id_yes" style=" left:330 ;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;">
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton"
style="color: #000000;top: 15;left: 0; ">PASS</text>
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton" style="color: #000000;top: 15;left: 0; ">PASS</text>
</div>
</div>
</div>
......@@ -70,7 +64,7 @@
// wifiEventJS.enableWLANSwitch();
// this.testTimer = this.$setTimeout(this.InterValTime, 5000, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestLicenseAuthor");
},
onHide: function () {
......
......@@ -54,14 +54,18 @@
onShow: function () {
//console.log(this.$uri + "===========onShow=============")
factory_testRtc.factoryTestRTCInit(this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestRtc");
},
onHide: function () {
factory_testRtc.exitTestRTC();
},
onQuit: function () {
factory_testRtc.exitTestRTC();
},
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.rtc = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
......
......@@ -62,7 +62,7 @@
// wifiEventJS.connect_wifi(initWifissid, initWifipwd);
// wifiEventJS.enableWLANSwitch();
// this.testTimer = this.$setTimeout(this.InterValTime, 5000, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestSound");
},
......
......@@ -5,12 +5,9 @@
</template>
<div id="id_pointDiv" style="top:0;left:0;width: 480;height: 480;background-color: transparent;"></div>
<text class="testReturn" id="id_yes" onpress="touchedScreen" onclick="touchedYesButton"
style="top: -480;left:256 ;color: #000000;background-color: #FF9700;">PASS</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton"
style="top: 256;left:32 ;color: #F44236;background-color: #858282;">NG</text>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton"
style="top: 384;left:128 ;color: #000000;background-color: #858282;">back</text>
<text class="testReturn" id="id_yes" onpress="touchedScreen" onclick="touchedYesButton" style="top: -480;left:256 ;color: #000000;background-color: #FF9700;">PASS</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton" style="top: 256;left:32 ;color: #F44236;background-color: #858282;">NG</text>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton" style="top: 384;left:128 ;color: #000000;background-color: #858282;">back</text>
</div>
</html>
......@@ -184,8 +181,8 @@
}, point_div_list)
},
resetDrawDiv: function () {
// if (point_div_list) {
point_div.removeChild(point_div_list)
// if (point_div_list) {
point_div.removeChild(point_div_list)
// return;
//}
point_div_list = document.createElement('div', {
......@@ -209,6 +206,7 @@
}
this.dataInit();
require("factory_testAtuo.js").atuoFactoryTest("factoryTestTouch");
// this.$enableMouseMoveEvent(true);
},
exitEvent: function () {
......
......@@ -5,41 +5,35 @@
<!-- </div> -->
<div style="left:20;top: 10;width: 440;height: 55; background-color: #99D0F7;">
<text class="fontsize40" id="title_TEXT"
style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
<text class="fontsize40" id="title_TEXT" style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
title_TEXT }}</text>
</div>
<div style="left:140 ; top:80 ;width: 200;height: 96;">
<text class="fontsize24" style="width: 200; top: 0;color: rgb(0, 0, 0);text-align: center;">发送次数</text>
<div style="left:0 ; top:34 ;width: 200;height: 96;background-color: #99D0F7">
<text class="fontsize24" id="sendCommValueText"
style="top: 15;width: 200;color:rgb(44, 123, 24);text-align: center;">{{sendCommValueText}}</text>
<text class="fontsize24" id="sendCommValueText" style="top: 15;width: 200;color:rgb(44, 123, 24);text-align: center;">{{sendCommValueText}}</text>
</div>
</div>
<div style="left:140 ; top:190 ;width: 200;height: 96;">
<text class="fontsize24" style="width: 200; top: 0;color: rgb(0, 0, 0);text-align: center;">接收次数</text>
<div style="left:0 ; top:34 ;width: 200;height: 96;background-color: #99D0F7">
<text class="fontsize24" id="recvCommValueText"
style="top: 15;width: 200;color:rgb(44, 123, 24);text-align: center;">{{recvCommValueText}}</text>
<text class="fontsize24" id="recvCommValueText" style="top: 15;width: 200;color:rgb(44, 123, 24);text-align: center;">{{recvCommValueText}}</text>
</div>
</div>
<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>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton" style="color: #000000; top: 15;">back</text>
</div>
<div style="left:110 ; width: 100;height: 96;background-color: #858282;">
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton"
style="color: #F44236;top: 15;">NG</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton" style="color: #F44236;top: 15;">NG</text>
</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;">
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton"
style="color: #000000;top: 15;left: 0; ">PASS</text>
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton" style="color: #000000;top: 15;left: 0; ">PASS</text>
</div>
</div>
......@@ -97,6 +91,8 @@
this.uartComm();
this.testTimer = this.$setInterval(this.InterValTime, 2000, [], this);
require("factory_testAtuo.js").atuoFactoryTest("factoryTestUartComm");
},
onHide: function () {
......
......@@ -1217,6 +1217,7 @@
this.refreshTimeFormatFlag(this.timeFormatFlag);
this.refreshTimeValue();
require("factory_testAtuo.js").atuoFactoryTest("factoryTestWifi");
},
onReady: function () {
......
......@@ -226,6 +226,9 @@
yesJumpPage.initPage(this.appItem);
yesJumpPage.testCode(this)
require("factory_testAtuo.js").initMianPage(this);
},
initShow: function () {
this.snShow();
......@@ -336,8 +339,12 @@
}
if (url == "factoryTestStart") {
//console.log("==============factoryTestStart================");
globalThis.factoryTest.atuoStart = 1;
url = "factoryTestColor";
}
else{
globalThis.factoryTest.atuoStart = 2;
}
if (url == "factoryTestExit") {
var systemCtrl = require("systemCtrl.js");
userData.factoryFlag = 0;
......@@ -401,7 +408,6 @@
globalThis.factoryTest.touch = 0;
globalThis.factoryTest.wifi = 0;
globalThis.factoryTest.sound = 0;
globalThis.factoryTest.uartComm = 0;
globalThis.factoryTest.bright = 0;
globalThis.factoryTest.licenseAuthor = 0;
......@@ -409,7 +415,6 @@
globalThis.factoryTest.burnIn = 0;
globalThis.factoryTest.systemCheck = 0;
globalThis.factoryTest.clearAll = 0;
globalThis.factoryTest.start = 0;
const saveObj = {
......
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
......@@ -42,17 +42,17 @@ function initFactoryTestBurnIn(obj) {
}, 5000);
// var result = getMemtesterData2("32M");
// console.log('Memtester Result:'+ result);
// //console.log('Memtester Result:'+ result);
// setInterval(() => {
// // 调用 getMemtesterData 函数,指定测试内存大小为 32M,并处理结果
// var result = getMemtesterData2("32M");
// console.log('Memtester Result:'+ result);
// //console.log('Memtester Result:'+ result);
// }, 20000);
}
function quitFactoryTestBurnIn() {
// exitMp4();
console.log("quitFactoryTestBurnIn");
//console.log("quitFactoryTestBurnIn");
if (id_testBurnInTimer != null) {
clearInterval(id_testBurnInTimer);
id_testBurnInTimer == null;
......@@ -98,15 +98,15 @@ function updateBurnInInfo() {
if (cntMemtester >= 2) {
if (commFlag == 1) {
var testSize = getTestMemorySize(); // 获取测试内存大小
console.log("!!testSize:" + testSize);
//console.log("!!testSize:" + testSize);
testMask = getTestMask();
console.log("!!testMask:" + testMask);
//console.log("!!testMask:" + testMask);
startCommMemtester(testSize);
commFlag = 0;
} else {
if (cntMemtester > 3) {
var memtester = getMemtester() //只能返回testMaskMap映射表的值,比如testMask为0x1,则memtester只能为值为OK 或者no
console.log("memtester:" + memtester);
//console.log("memtester:" + memtester);
cntMemtester = 0;
commFlag = 1;
that.crtMemorycrtMemtester = memtester;
......@@ -139,7 +139,7 @@ function getCPUModel() {
const modelMatch = modelStr.match(/model name\s*: (.+)/i);
if (modelMatch) {
const fullModel = modelMatch[1].trim();
console.log("CPU Model: " + fullModel);
//console.log("CPU Model: " + fullModel);
// 检查是否包含 "v7-M",以决定输出哪个型号
if (fullModel.includes("v7-M")) {
......@@ -209,7 +209,7 @@ function getMemoryInfo() {
const memUsed = parts[2]; // 使用量
const memAvailable = parts[parts.length - 2]; // 可用内存通常在倒数第二个位置
//内存总量、空闲总量、使用总量
console.log('Memory Info:memTotal:' + memTotal + ' memUsed:' + memUsed + ' memAvailable:' + memAvailable);
//console.log('Memory Info:memTotal:' + memTotal + ' memUsed:' + memUsed + ' memAvailable:' + memAvailable);
return {
total: memTotal,
used: memUsed,
......@@ -276,7 +276,7 @@ function getTestMask() {
function startCommMemtester(testSize) {
var testCount = 1;
var str = `memtester -m ${testMask} ${testSize} ${testCount} > /tmp/memtester.txt`;
console.log(str);
//console.log(str);
system(str);
}
......@@ -327,23 +327,23 @@ function getAvailableMemory() {
function getTestMemorySize() {
const availableMemory = getAvailableMemory();
if (availableMemory === "NA") {
console.log("Failed to get available memory");
//console.log("Failed to get available memory");
return "64M"; // 默认值
}
const memValue = parseFloat(availableMemory);
if (isNaN(memValue)) {
console.log("Invalid memory value:", availableMemory);
//console.log("Invalid memory value:", availableMemory);
return "64M"; // 默认值
}
// 将 KB 转换为 MB(1MB = 1024 KB)
const memValueInM = (memValue / 1024).toFixed(0);
console.log(`Available Memory: ${memValueInM}M`);
//console.log(`Available Memory: ${memValueInM}M`);
// 计算测试内存大小(空闲内存的 80%)
const testSizeInM = (memValueInM * 0.5).toFixed(0);
console.log(`Test Memory Size: ${testSizeInM}M`);
//console.log(`Test Memory Size: ${testSizeInM}M`);
return testSizeInM + 'M'; // 返回 MB 单位的测试内存大小
}
......@@ -353,7 +353,7 @@ function getLogInfo() {
delayExecute(() => {
const logInfoStr = fs.read("/tmp/loginfo.txt", "r");
if (logInfoStr) {
console.log('Log Info:' + logInfoStr);
//console.log('Log Info:' + logInfoStr);
return logInfoStr;
} else {
console.error('Failed to read log info');
......@@ -367,7 +367,7 @@ function getDiskInfo() {
delayExecute(() => {
const diskInfoStr = fs.read("/tmp/diskinfo.txt", "r");
if (diskInfoStr) {
console.log('Disk Info:' + diskInfoStr);
//console.log('Disk Info:' + diskInfoStr);
return diskInfoStr;
} else {
console.error('Failed to read disk info');
......
......@@ -14,6 +14,12 @@ function system(str) {
}
function exitTestRTC(){
if (id_testRtcTimer != null) {
clearInterval(id_testRtcTimer);
id_testRtcTimer == null;
}
}
function factoryTestRTCInit(obj) {
that = obj;
......@@ -23,8 +29,6 @@ function factoryTestRTCInit(obj) {
}
updateRtcInfo();
id_testRtcTimer = setInterval(() => {
updateRtcInfo();
}, 5000);
}
......@@ -37,7 +41,7 @@ function setTextColorById(that, id, value) {
function updateRtcInfo() {
var rtc = getRtcTime();
that.crtLocalTime = rtc;
console.log("hwRtc:" + rtc);
//console.log("hwRtc:" + rtc);
......@@ -71,6 +75,7 @@ function getRtcTime() {
module.exports = {
factoryTestRTCInit: factoryTestRTCInit,
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