Commit a1c90f31 authored by lyong's avatar lyong

优化老化测试视频播放

parent 6d70ad27
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="screen" onpress="onChildLockPress" onrelease="onChildLockRelease"> <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"> <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);">长按重启</text>
<div style="left:240;top: 0;text-align: left;width: 240;height:30;background-color:#FFFFFF; opacity: 0.7;"> <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> <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> <text class="fontsize22Left" style="left:3;top: 0;text-align: left;width: 80;color: #000000; ">{{crtMousemoveX}}</text>
......
...@@ -31,7 +31,7 @@ function system(str) { ...@@ -31,7 +31,7 @@ function system(str) {
} }
function initFactoryTestBurnIn(obj) { function initFactoryTestBurnIn(obj) {
that = obj; that = obj;
// startMp4(); startMp4();
if (id_testBurnInTimer != null) { if (id_testBurnInTimer != null) {
clearInterval(id_testBurnInTimer); clearInterval(id_testBurnInTimer);
id_testBurnInTimer == null; id_testBurnInTimer == null;
...@@ -51,7 +51,7 @@ function initFactoryTestBurnIn(obj) { ...@@ -51,7 +51,7 @@ function initFactoryTestBurnIn(obj) {
} }
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);
...@@ -63,17 +63,31 @@ function quitFactoryTestBurnIn() { ...@@ -63,17 +63,31 @@ function quitFactoryTestBurnIn() {
function startMp4() { function startMp4() {
// lvgl.lv_set_screen_transparent(true); // lvgl.lv_set_screen_transparent(true);
systemCtrl.executeSystemCommand("tplayerdemo /mnt/app/quicknode/tests/re860_factory/images/factory/testVideo240p.mp4 &"); systemCtrl.executeSystemCommand("tplayerdemo /mnt/app/quicknode/tests/re860_factory/images/factory/testVideo240p.mp4 &");
// systemCtrl.executeSystemCommand("quit");
// router.push({ // router.push({
// path: "factoryTestBurnIn" // path: "factoryTestBurnIn"
// }); // });
} }
function exitMp4() { 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 &"); systemCtrl.executeSystemCommand("killall -9 tplayerdemo &");
// console.log("!!!!!!!!!quitMp4 3");
// }, 1000);
// lvgl.lv_set_screen_transparent(false); // lvgl.lv_set_screen_transparent(false);
systemCtrl.executeSystemCommand("reboot 1");
systemCtrl.executeSystemCommand("quit");
} }
function setTextColorById(that, id, value) { function setTextColorById(that, id, value) {
const color = (value === "NA") ? "#ff0000" : "#00ff00"; const color = (value === "NA") ? "#ff0000" : "#00ff00";
...@@ -199,11 +213,17 @@ function getMemoryInfo() { ...@@ -199,11 +213,17 @@ function getMemoryInfo() {
const memStr = fs.read("/tmp/meminfo.txt", "r"); const memStr = fs.read("/tmp/meminfo.txt", "r");
if (memStr) { if (memStr) {
const lines = memStr.split('\n'); const lines = memStr.split('\n');
if(!lines){
return "NG";
}
// 跳过表头 // 跳过表头
for (let i = 1; i < lines.length; i++) { for (let i = 1; i < lines.length; i++) {
const line = lines[i].trim(); const line = lines[i].trim();
if (line.startsWith("Mem")) { if (line.startsWith("Mem")) {
const parts = line.split(/\s+/); const parts = line.split(/\s+/);
if(!parts){
return "NG";
}
if (parts.length > 1) { if (parts.length > 1) {
const memTotal = parts[1]; // 总量 const memTotal = parts[1]; // 总量
const memUsed = parts[2]; // 使用量 const memUsed = parts[2]; // 使用量
...@@ -269,7 +289,7 @@ function delayExecute(func, delay) { ...@@ -269,7 +289,7 @@ function delayExecute(func, delay) {
function getTestMask() { function getTestMask() {
const testMasks = Object.keys(testMaskMap); const testMasks = Object.keys(testMaskMap);4
strMemtesterCnt = (strMemtesterCnt + 1) % testMasks.length; strMemtesterCnt = (strMemtesterCnt + 1) % testMasks.length;
return testMasks[strMemtesterCnt]; return testMasks[strMemtesterCnt];
} }
...@@ -309,6 +329,9 @@ function getAvailableMemory() { ...@@ -309,6 +329,9 @@ function getAvailableMemory() {
const memStr = fs.read("/tmp/meminfo.txt", "r"); const memStr = fs.read("/tmp/meminfo.txt", "r");
if (memStr) { if (memStr) {
const lines = memStr.split('\n'); const lines = memStr.split('\n');
if(!lines){
return "NG";
}
for (let i = 1; i < lines.length; i++) { for (let i = 1; i < lines.length; i++) {
const line = lines[i].trim(); const line = lines[i].trim();
if (line.startsWith("Mem")) { if (line.startsWith("Mem")) {
...@@ -337,7 +360,7 @@ function getTestMemorySize() { ...@@ -337,7 +360,7 @@ function getTestMemorySize() {
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`);
......
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