Commit bdd32985 authored by lyong's avatar lyong

增加产测RTC 和老化测试

parent 2267164b
This diff is collapsed.
<html>
<div class="screen" onclick="touchedScreen">
<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;">RTC测试</text>
</div>
<div style="left:0;top:100;width:480;height:480; " id="tipDiv">
<text class="fontsize40" style="left:1;top: 0;text-align: center ;width: 480;height:80; color: black;">本地时间</text>
<!-- <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> -->
</div>
<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>
</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>
</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>
</div> -->
<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>
</div>
</div>
</div>
</html>
<script>
var router = require("@system.router");
var lvgl = require("@native.lvgl7");
var factory_testRtc = require("factory_testRtc.js");
export default {
data: {
crtLocalTime: "NA",
imgCnt: 0,
pngCnt: 0,
gifIconSrc: "",
},
/*************** struct ***************/
onInit: function () {
},
onShow: function () {
//console.log(this.$uri + "===========onShow=============")
factory_testRtc.factoryTestRTCInit(this);
},
onHide: function () {
},
onQuit: function () {
},
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.rtc = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestSound);")
yesJumpPage.yesGoToNextPage("factoryTestBurnIn");
},
touchedNGButton: function (node, topNode, x, y) {
globalThis.factoryTest.rtc = 2;
router.push({
path: "factory_testList",
});
},
touchedBackButton: function (node, topNode, x, y) {
router.push({
path: "factory_testList",
});
},
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);
},
}
</script>
<style>
.screen {
top: 0;
left: 0;
width: 480;
height: 480;
background-color: #A8A8A8;
/* color: black; */
}
/*********************************/
#id_color {
width: 480;
height: 480;
background-color: black;
}
#reminderText {
top: 40;
width: 500;
height: 100;
border-radius: 10;
border-width: 2;
border-color: white;
text-align: left;
/* text-overflow: ellipsis; */
font-size: 60;
color: white;
background-color: transparent;
}
.class_msg {
top: 240;
width: 200;
height: 100;
border-radius: 10;
border-width: 2;
border-color: white;
text-align: center;
text-overflow: ellipsis;
font-size: 60;
color: red;
background-color: gainsboro;
}
#id_yes {
bottom: 20px;
left: 20px;
}
#id_ng {
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;
}
.fontsize24 {
height: 35;
text-align: center;
text-overflow: ellipsis;
font-size: 24;
color: #ffffff;
background-color: transparent;
}
.fontsize40 {
text-align: center;
text-overflow: ellipsis;
font-size: 40;
color: #ffffff;
background-color: transparent;
}
.testReturn {
position: absolute;
width: 100;
height: 96;
text-align: center;
text-overflow: ellipsis;
font-size: 44;
}
</style>
\ No newline at end of file
......@@ -125,7 +125,6 @@
left: 0;
width: 480;
height: 480;
background-color: #A8A8A8;
/* color: black; */
}
......
<html>
<div class="screen" onclick="touchedBg">
<template for="appItem" key="app" index="index">
<div class="chooseBlock" id="app.id" :url="app.startup" :ena="app.en" :top="app.top" :left="app.left"
onclick="touchedBlock">
<div class="chooseBlock" id="app.id" :url="app.startup" :ena="app.en" :top="app.top" :left="app.left" onclick="touchedBlock">
<text class="testName" :url="app.startup" :ena="app.en">{{
app.name
}}</text>
......@@ -117,6 +116,24 @@
en: 1,
index: 7,
},
{
id: "id_factoryTestRtc",
name: "RTC测试",
startup: "factoryTestRtc",
top: 100,
left: 350,
en: 1,
index: 8,
},
{
id: "id_factoryTestBurnIn",
name: "老化测试",
startup: "factoryTestBurnIn",
top: 190,
left: 20,
en: 1,
index: 9,
},
{
id: "id_factoryTestsystemCheck",
name: "系统检测",
......@@ -170,6 +187,8 @@
uartComm: 0,
bright: 0,
licenseAuthor: 0,
rtc: 0,
burnIn: 0,
systemCheck: 0,
clearAll: 0,
start: 0,
......@@ -184,8 +203,8 @@
const properties = [
"color", "touch", "wifi", "sound",
"uartComm", "bright", "licenseAuthor",
"systemCheck", "clearAll", "start"
"uartComm", "bright", "licenseAuthor", "rtc",
"burnIn", "systemCheck", "clearAll", "start"
];
......@@ -230,6 +249,7 @@
},
onShow: function () {
//lvgl.lv_set_screen_transparent(false);
//console.log(this.$uri + "===========onShow=============");
if (userData.factoryFlag != 1) {
userData.factoryFlag = 1;
......@@ -259,8 +279,8 @@
const properties = [
"color", "touch", "wifi", "sound",
"uartComm", "bright", "licenseAuthor",
"systemCheck", "clearAll", "start"
"uartComm", "bright", "licenseAuthor", "rtc",
"burnIn", "systemCheck", "clearAll", "start"
];
......@@ -318,9 +338,9 @@
//console.log("==============factoryTestStart================");
url = "factoryTestColor";
}
if(url == "factoryTestExit"){
var systemCtrl = require("systemCtrl.js");
userData.factoryFlag = 0;
if (url == "factoryTestExit") {
var systemCtrl = require("systemCtrl.js");
userData.factoryFlag = 0;
systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/runFactory.sh 0");
}
router.push({
......@@ -345,10 +365,12 @@
{ index: 4, property: "uartComm" },
{ index: 5, property: "bright" },
{ index: 6, property: "licenseAuthor" },
{ index: 7, property: "systemCheck" },
{ index: 8, property: "clearAll" },
{ index: 7, property: "rtc" },
{ index: 8, property: "burnIn" },
{ index: 9, property: "systemCheck" },
{ index: 10, property: "clearAll" },
// { index: 9, property: "pcba" },
{ index: 9, property: "start" },
{ index: 11, property: "start" },
];
......@@ -383,6 +405,8 @@
globalThis.factoryTest.uartComm = 0;
globalThis.factoryTest.bright = 0;
globalThis.factoryTest.licenseAuthor = 0;
globalThis.factoryTest.rtc = 0;
globalThis.factoryTest.burnIn = 0;
globalThis.factoryTest.systemCheck = 0;
globalThis.factoryTest.clearAll = 0;
......@@ -397,6 +421,8 @@
uartComm: globalThis.factoryTest.uartComm,
bright: globalThis.factoryTest.bright,
licenseAuthor: globalThis.factoryTest.licenseAuthor,
rtc: globalThis.factoryTest.rtc,
burnIn: globalThis.factoryTest.burnIn,
systemCheck: globalThis.factoryTest.systemCheck,
clearAll: globalThis.factoryTest.clearAll,
// pcba: globalThis.factoryTest.pcba,
......@@ -420,6 +446,8 @@
uartComm: globalThis.factoryTest.uartComm,
bright: globalThis.factoryTest.bright,
licenseAuthor: globalThis.factoryTest.licenseAuthor,
rtc: globalThis.factoryTest.rtc,
burnIn: globalThis.factoryTest.burnIn,
systemCheck: globalThis.factoryTest.systemCheck,
clearAll: globalThis.factoryTest.clearAll,
// pcba: globalThis.factoryTest.pcba,
......
This diff is collapsed.
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 rtcCtl = require("factory_rtc.js");
function system(str) {
systemCtrl.executeSystemCommand(str);
}
function factoryTestRTCInit(obj) {
that = obj;
if (id_testRtcTimer != null) {
clearInterval(id_testRtcTimer);
id_testRtcTimer == null;
}
updateRtcInfo();
id_testRtcTimer = setInterval(() => {
updateRtcInfo();
}, 5000);
}
function setTextColorById(that, id, value) {
const color = (value === "NA") ? "#ff0000" : "#00ff00";
that.$setTextColor(id, color);
}
function updateRtcInfo() {
var rtc = getRtcTime();
that.crtLocalTime = rtc;
console.log("hwRtc:" + rtc);
setTextColorById(that, 'id_crtLocalTime', that.crtLocalTime);
var values = [that.crtLocalTime];
var allValuesValid = values.every(value => value !== "NA");
// 根据检查结果设置烧录测试状态
globalThis.factoryTest.rtc = allValuesValid ? 1 : 2;
var Yval = allValuesValid == 1 ? 0 : -480
that.$setY("id_yes",Yval)
}
function getRtcTime() {
system("hwclock > /tmp/hwRtc.txt");
const coresStr = fs.read("/tmp/hwRtc.txt", "r");
if (coresStr) {
return coresStr.split('\n');
} else {
// system("killall -9 /dev/rtc0");
return "NA";
}
}
module.exports = {
factoryTestRTCInit: factoryTestRTCInit,
}
\ 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