Commit ffd6cb68 authored by lyong's avatar lyong

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

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