Commit 7013bf2f authored by lyong's avatar lyong

优化老化测试

parent a1c90f31
......@@ -39,7 +39,7 @@
<text class="fontsize22" id="id_crtMemoryTotal" style="left:5;top: 0;text-align: left ;width: 110;height:110;">{{crtMemoryTotal}}</text>
<text class="fontsize22" id="id_crtMemoryUsed" style="left:5;top: 45;text-align: left ;width: 110;height:110;">{{crtMemoryUsed}}</text>
<text class="fontsize22" id="id_crtMemoryAvailable" style="left:5;top: 90;text-align: left ;width: 110;height:110;">{{crtMemoryAvailable}}</text>
<text class="fontsize18" id="id_crtMemorycrtMemtester" style="left:5;top: 120;text-align: left ;width: 110;height:110;">{{crtMemorycrtMemtester}}</text>
<text class="fontsize16" id="id_crtMemorycrtMemtester" style="left:5;top: 130;text-align: left ;width: 110;height:75;">{{crtMemorycrtMemtester}}</text>
</div>
</div>
<div style="left:0;top:240;width:480;height:240;">
......@@ -284,7 +284,15 @@
color: #FFFFFF;
background-color: transparent;
}
.fontsize16 {
width: 120;
height: 30;
text-align: center;
text-overflow: ellipsis;
font-size: 16;
color: #FFFFFF;
background-color: transparent;
}
.fontsize18 {
top: 90;
width: 200;
......
......@@ -96,6 +96,13 @@ function setTextColorById(that, id, value) {
var cntMemtester = 2;
var testMask = 0x1;
var commFlag = 1;
function setTextColorByMemtester(){
// 0 = 绿色,1 = 红色
const memColor = that.crtMemorycrtMemtester.includes(': OK') ? '#00ff00' : '#ff0000';
that.$setTextColor('id_crtMemorycrtMemtester', memColor);
}
function updateBurnInInfo() {
that.crtCPUModel = getCPUModel();
that.crtCPUCores = getCPUCores();
......@@ -124,6 +131,7 @@ function updateBurnInInfo() {
cntMemtester = 0;
commFlag = 1;
that.crtMemorycrtMemtester = memtester;
setTextColorByMemtester();
}
}
}
......@@ -213,7 +221,7 @@ function getMemoryInfo() {
const memStr = fs.read("/tmp/meminfo.txt", "r");
if (memStr) {
const lines = memStr.split('\n');
if(!lines){
if (!lines) {
return "NG";
}
// 跳过表头
......@@ -221,7 +229,7 @@ function getMemoryInfo() {
const line = lines[i].trim();
if (line.startsWith("Mem")) {
const parts = line.split(/\s+/);
if(!parts){
if (!parts) {
return "NG";
}
if (parts.length > 1) {
......@@ -289,7 +297,7 @@ function delayExecute(func, delay) {
function getTestMask() {
const testMasks = Object.keys(testMaskMap);4
const testMasks = Object.keys(testMaskMap); 4
strMemtesterCnt = (strMemtesterCnt + 1) % testMasks.length;
return testMasks[strMemtesterCnt];
}
......@@ -329,7 +337,7 @@ function getAvailableMemory() {
const memStr = fs.read("/tmp/meminfo.txt", "r");
if (memStr) {
const lines = memStr.split('\n');
if(!lines){
if (!lines) {
return "NG";
}
for (let i = 1; i < lines.length; i++) {
......
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