Commit 7013bf2f authored by lyong's avatar lyong

优化老化测试

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