Commit 8700e8c9 authored by waterword's avatar waterword

refactor: 注释掉多余的 console.log 语句

- 在多个文件中注释掉了大量的 console.log 语句,减少了日志输出
- 优化了代码结构,提高了代码可读性和性能
- 这些更改不影响功能,仅清理了调试代码
parent 0a490c8c
// globalThis.cslog = console.log
// console.log = function () {
// globalThis.cslog = //console.log
// //console.log = function () {
// }
// console.trace = function () {
......@@ -35,7 +35,7 @@ function onCreate(uri) {
}
var process = require("@system.process")
if (process.platform == "win32") {
console.log("its win32.")
//console.log("its win32.")
globalThis.Simu.En = 1
}
globalThis.DEV = {
......@@ -43,7 +43,7 @@ function onCreate(uri) {
}
initEventLister();
gc();
console.log(showMemInfo());
//console.log(showMemInfo());
var evue = require("router.js");
var router = evue.router;
......@@ -55,21 +55,21 @@ function onCreate(uri) {
if (startUrl() == undefined) {
times.push(clock());
gc();
console.log(showMemInfo());
//console.log(showMemInfo());
router.push({ 'path': uri });
times.push(clock());
console.log(times)
//console.log(times)
gc();
console.log(showMemInfo());
//console.log(showMemInfo());
} else {
times.push(clock());
var uriObj = JSON.parse(globalThat.$uri);
console.log(uriObj);
//console.log(uriObj);
router.push(uriObj);
times.push(clock());
console.log(times)
//console.log(times)
gc();
console.log(showMemInfo());
//console.log(showMemInfo());
}
}
......@@ -77,7 +77,7 @@ function onCreate(uri) {
// var router = require("@system.router");
// var keypad = require("keypadCode.js")
// keypad.triggerByCode(code)
// console.log("++++ CodeNum:" + code)
// //console.log("++++ CodeNum:" + code)
// return
// if (code == 62) {
// router.pageDebug(!router.debugOn);
......
No preview for this file type
......@@ -83,11 +83,11 @@
},
onHide: function () {
console.log(this.$uri + "===========onHide=============");
//console.log(this.$uri + "===========onHide=============");
this.clearTimer();
},
onQuit: function () {
console.log(this.$uri + "===========onQuit=============");
//console.log(this.$uri + "===========onQuit=============");
this.clearTimer();
},
clearTimer: function () {
......@@ -98,7 +98,7 @@
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.bright = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestBright);")
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestBright);")
yesJumpPage.yesGoToNextPage("factoryTestBright");
},
touchedNGButton: function (node, topNode, x, y) {
......@@ -119,7 +119,7 @@
movePage: function (oldPage, newPage) {
console.log(oldPage + "==========to==========" + newPage);
//console.log(oldPage + "==========to==========" + newPage);
this.$hide(oldPage); // 跳转页面之前立即关掉toast
this.$setY(oldPage, -480); // hide
this.$show(newPage)
......@@ -127,13 +127,13 @@
},
onBrightnessValueChanged: function (node, value) {
console.log("value=" + value);
//console.log("value=" + value);
this.brightnessValue = value;
this.crtBrightnessValue = value;
var tempWidth = Math.round((value / 100) * 324);
this.$setWidth("id_setBrightnessLineShowDiv", tempWidth);
console.log("value=" + value);
console.log("send onBrightnessValueChanged signal!");
//console.log("value=" + value);
//console.log("send onBrightnessValueChanged signal!");
this.onBrightnessValueChangedEvent(this.brightnessValue);
......@@ -141,16 +141,16 @@
onBrightnessValueRelease: function (node, topnode, x, y) {
console.log("send onBrightnessValueRelease signal!");
//console.log("send onBrightnessValueRelease signal!");
},
onBrightnessValueChangedEvent: function (brightnessValue) {
console.log("receive onBrightnessValueChangedEvent singal!");
//console.log("receive onBrightnessValueChangedEvent singal!");
// todo: 控制屏幕亮度, brightnessValue:0~100
// userData.brightnessValue = brightnessValue;
var value = Math.round(brightnessValue * 255 / 100);
console.log("onBrightnessValueChangedEvent value=" + value);
//console.log("onBrightnessValueChangedEvent value=" + value);
bglight.ctrl(value);
}
};
......
......@@ -67,7 +67,7 @@
//this.$setImageForceUpdate(true);
},
onShow: function () {
console.log(this.$uri + "===========onShow=============")
//console.log(this.$uri + "===========onShow=============")
this.$hide("id_testPng")
this.$hide("id_yes")
this.$hide("id_ng")
......@@ -80,11 +80,11 @@
this.imgCnt++
},
onHide: function () {
console.log(this.$uri + "===========onHide=============")
//console.log(this.$uri + "===========onHide=============")
this.clearTimer()
},
onQuit: function () {
console.log(this.$uri + "===========onQuit=============")
//console.log(this.$uri + "===========onQuit=============")
this.clearTimer()
},
......@@ -104,7 +104,7 @@
shortDelay: function () {
this.$setX("id_ng", 800);
this.$setY("id_ng", 340);
console.log("=====show id_ng successful!")
//console.log("=====show id_ng successful!")
this.$clearTimeout(this.shortDelayId);
},
......@@ -118,7 +118,7 @@
this.checkFlagBash2(this.pngCnt)
this.pngCnt++
if (this.pngCnt == this.colorBashPng.length) {
console.log("=====show id_yes successful!")
//console.log("=====show id_yes successful!")
this.$show("id_yes")
this.$show("id_ng")
this.$show("id_back")
......@@ -134,7 +134,7 @@
// path: "factory_testList"
// }
var yesJumpPage = require("factoryYesJumpPage.js");
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestColor);")
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestColor);")
yesJumpPage.yesGoToNextPage("factoryTestColor");
//);
......@@ -155,18 +155,18 @@
},
/*************** gesture ***************/
onGestureEvent: function (dir, x, y) {
console.log(dir + " " + x + " " + y);
//console.log(dir + " " + x + " " + y);
},
/*************** work ***************/
checkFlagBash: function (val) {
var temp = this.colorBash[val].val
console.log("tempType = " + typeof temp)
console.log("tempValue = " + temp)
//console.log("tempType = " + typeof temp)
//console.log("tempValue = " + temp)
this.$setBackgroundColor("id_color", temp)
},
checkFlagBash2: function (val) {
var temp = this.colorBashPng[val].val
console.log("tempValue = " + temp)
//console.log("tempValue = " + temp)
this.gifIconSrc = temp;
this.$show("id_testPng")
},
......
......@@ -74,11 +74,11 @@
},
onHide: function () {
console.log(this.$uri + "===========onHide=============");
//console.log(this.$uri + "===========onHide=============");
this.clearTimer();
},
onQuit: function () {
console.log(this.$uri + "===========onQuit=============");
//console.log(this.$uri + "===========onQuit=============");
this.clearTimer();
},
clearTimer: function () {
......@@ -89,7 +89,7 @@
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.licenseAuthor = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestLicenseAuthor);")
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestLicenseAuthor);")
yesJumpPage.yesGoToNextPage("factoryTestLicenseAuthor");
},
touchedNGButton: function (node, topNode, x, y) {
......@@ -110,12 +110,12 @@
var partFilePath = "../../../../../mnt/extsd/msdkFiles/" + filenm
if (fs.exists(partFilePath)) {
this.crtBrightnessValue = "已注册!"
console.log("the " + filenm + " is exists.")
//console.log("the " + filenm + " is exists.")
this.$setY("id_yes", 0);
return 0
}
// console.log("the " + filenm + " is exists.")
// //console.log("the " + filenm + " is exists.")
this.crtBrightnessValue = "未注册"
......@@ -123,7 +123,7 @@
},
movePage: function (oldPage, newPage) {
console.log(oldPage + "==========to==========" + newPage);
//console.log(oldPage + "==========to==========" + newPage);
this.$hide(oldPage); // 跳转页面之前立即关掉toast
this.$setY(oldPage, -480); // hide
this.$show(newPage)
......
......@@ -67,11 +67,11 @@
},
onHide: function () {
console.log(this.$uri + "===========onHide=============");
//console.log(this.$uri + "===========onHide=============");
this.clearTimer();
},
onQuit: function () {
console.log(this.$uri + "===========onQuit=============");
//console.log(this.$uri + "===========onQuit=============");
this.clearTimer();
},
clearTimer: function () {
......@@ -82,7 +82,7 @@
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.sound = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestSound);")
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestSound);")
yesJumpPage.yesGoToNextPage("factoryTestSound");
},
touchedNGButton: function (node, topNode, x, y) {
......@@ -109,7 +109,7 @@
},
movePage: function (oldPage, newPage) {
console.log(oldPage + "==========to==========" + newPage);
//console.log(oldPage + "==========to==========" + newPage);
this.$hide(oldPage); // 跳转页面之前立即关掉toast
this.$setY(oldPage, -480); // hide
this.$show(newPage)
......
......@@ -121,7 +121,7 @@
for (x = 0; x < 15; x++) {
for (y = 0; y < 15; y++) {
var relId = "id_block" + x + "_" + y;
console.log("relId :" + relId);
////console.log("relId :" + relId);
this.$setBackgroundColor(relId, 0xFFFFFF)
}
}
......@@ -142,7 +142,7 @@
// var dom = require("dom.js"); app.js引入
pointInit: function () {
var getPointTopDiv = document.getElementById('id_pointDiv');
console.log("getPointTopDiv:" + getPointTopDiv);
////console.log("getPointTopDiv:" + getPointTopDiv);
if (!getPointTopDiv)
return
......@@ -201,8 +201,8 @@
},
onShow: function () {
console.log(this.$uri + "===========factoryTestTouch onShow=============");
console.log("FirstStartupFlag:" + FirstStartupFlag);
////console.log(this.$uri + "===========factoryTestTouch onShow=============");
////console.log("FirstStartupFlag:" + FirstStartupFlag);
if (FirstStartupFlag == 1) {
this.timerSet();
this.pointInit();
......@@ -233,12 +233,12 @@
this.resetDrawDiv();
},
onHide: function () {
console.log(this.$uri + "===========factoryTestTouch onHide=============");
////console.log(this.$uri + "===========factoryTestTouch onHide=============");
this.clearTimer();
this.exitEvent();
},
onQuit: function () {
console.log(this.$uri + "===========factoryTestTouch onQuit=============");
////console.log(this.$uri + "===========factoryTestTouch onQuit=============");
this.clearTimer();
this.exitEvent();
},
......@@ -253,7 +253,7 @@
initDiv: function (x, y) {
var relId = "id_block" + x + "_" + y;
console.log("relId :" + relId);
////console.log("relId :" + relId);
this.$setPos(relId, x * 32, y * 32);
// if (this.flagBashStd[x][y] == 1) {
// this.$setBackgroundColor(relId, 0x000000);
......@@ -261,7 +261,7 @@
},
chanelDiv: function (x, y) {
var relId = "id_block" + x + "_" + y;
console.log("relId :" + relId);
////console.log("relId :" + relId);
this.$setPos(relId, -480, -480);
this.$setBackgroundColor(relId, 0x000000)
this.flagBashStd[x][y] = 1;
......@@ -275,7 +275,7 @@
var divwidth = 32;
var xmax = 480 / divwidth;
var ymax = 480 / divheight;
console.log("xmax :" + xmax + "ymax :" + ymax);
////console.log("xmax :" + xmax + "ymax :" + ymax);
......@@ -290,7 +290,7 @@
this.chanelDiv(x, y)
}
// var relId = "id_block" + x +"_"+ y;
// console.log("relId :" + relId);
// ////console.log("relId :" + relId);
// this.$setPos(relId, x * 32, y * 32);
// if (this.flagBashStd[x][y] == 1) {
// this.$setBackgroundColor(relId, 0x000000);
......@@ -305,7 +305,7 @@
/*************** gesture ***************/
onGestureEvent: function (dir, x, y) {
console.log(dir + " " + x + " " + y);
////console.log(dir + " " + x + " " + y);
},
figCoor: function (x, y) {
var divwidth = 32;
......@@ -316,47 +316,47 @@
// 确保 gridX 和 gridY 在 0-14 的范围内
gridX = Math.max(0, Math.min(gridX, 14));
gridY = Math.max(0, Math.min(gridY, 14));
console.log("gridX: " + gridX + " gridY: " + gridY);
////console.log("gridX: " + gridX + " gridY: " + gridY);
this.flagBash[gridX][gridY] = 1;
if (this.flagBashStd[gridX][gridY] == 1) {
return undefined;
}
var coor = gridX + "_" + gridY;
console.log(coor);
////console.log(coor);
return coor;
},
// refDivColor: function (coor) {
// var relId = "id_block" + coor
// console.log("relId :" + relId);
// ////console.log("relId :" + relId);
// this.$setBackgroundColor(relId, 0x00ff00);
// // this.$setPos(relId, gridX * 32, gridY * 32); // 确保位置正确
// },
refChannleDivColor: function (coor) {
var relId = "id_block" + coor;
console.log("refDivColor - relId: " + relId);
////console.log("refDivColor - relId: " + relId);
if (document.getElementById(relId)) {
console.log("Element found: " + relId);
////console.log("Element found: " + relId);
this.$setBackgroundColor(relId, 0xFFFFFF);
} else {
console.log("Element not found: " + relId);
////console.log("Element not found: " + relId);
}
},
refDivColor: function (coor) {
var relId = "id_block" + coor;
console.log("refDivColor - relId: " + relId);
////console.log("refDivColor - relId: " + relId);
if (document.getElementById(relId)) {
console.log("Element found: " + relId);
////console.log("Element found: " + relId);
this.$setBackgroundColor(relId, 0x00ff00);
} else {
console.log("Element not found: " + relId);
////console.log("Element not found: " + relId);
}
},
onmousemove: function (gx, gy, topNode, x, y) {
console.log("onmousemove--->gx:" + gx + " gy:" + gy);
////console.log("onmousemove--->gx:" + gx + " gy:" + gy);
if (gx > 480 || gy > 480)
return;
......@@ -375,7 +375,7 @@
// // }
// },
touchedScreen: function (node, topNode, x, y) {
console.log("X:" + x + " Y:" + y);
////console.log("X:" + x + " Y:" + y);
this.$enableMouseMoveEvent(true);
},
releasedScreen: function (node, topNode, x, y) {
......@@ -407,7 +407,7 @@
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.touch = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestTouch);")
////console.log("=====yesJumpPage.yesGoToNextPage(factoryTestTouch);")
yesJumpPage.yesGoToNextPage("factoryTestTouch");
},
touchedNGButton: function (node, topNode, x, y) {
......
......@@ -29,7 +29,7 @@
for (x = 0; x < 15; x++) {
for (y = 0; y < 15; y++) {
var relId = "id_block" + x + "_" + y;
console.log("relId :" + relId);
//console.log("relId :" + relId);
this.$setBackgroundColor(relId, 0xFFFFFF)
}
}
......@@ -39,7 +39,7 @@
// var dom = require("dom.js"); app.js引入
pointInit: function () {
var getPointTopDiv = document.getElementById('id_pointDiv');
console.log("getPointTopDiv:" + getPointTopDiv);
//console.log("getPointTopDiv:" + getPointTopDiv);
if (!getPointTopDiv)
return
......@@ -105,8 +105,8 @@
},
onShow: function () {
console.log(this.$uri + "===========factoryTestTouch onShow=============");
console.log("FirstStartupFlag:" + FirstStartupFlag);
//console.log(this.$uri + "===========factoryTestTouch onShow=============");
//console.log("FirstStartupFlag:" + FirstStartupFlag);
if (FirstStartupFlag == 1) {
// this.timerSet();
this.pointInit();
......@@ -116,12 +116,12 @@
},
onHide: function () {
console.log(this.$uri + "===========factoryTestTouch onHide=============");
//console.log(this.$uri + "===========factoryTestTouch onHide=============");
this.clearTimer();
},
onQuit: function () {
console.log(this.$uri + "===========factoryTestTouch onQuit=============");
//console.log(this.$uri + "===========factoryTestTouch onQuit=============");
this.clearTimer();
},
......@@ -134,7 +134,7 @@
initDiv: function (x, y) {
var relId = "id_block" + x + "_" + y;
console.log("relId :" + relId);
//console.log("relId :" + relId);
this.$setPos(relId, x * 32, y * 32);
// if (this.flagBashStd[x][y] == 1) {
// this.$setBackgroundColor(relId, 0x000000);
......@@ -142,7 +142,7 @@
},
chanelDiv: function (x, y) {
var relId = "id_block" + x + "_" + y;
console.log("relId :" + relId);
//console.log("relId :" + relId);
this.$setPos(relId, -480, -480);
this.$setBackgroundColor(relId, 0x000000)
this.flagBashStd[x][y] = 1;
......@@ -154,40 +154,40 @@
/*************** gesture ***************/
onGestureEvent: function (dir, x, y) {
console.log(dir + " " + x + " " + y);
//console.log(dir + " " + x + " " + y);
},
// refDivColor: function (coor) {
// var relId = "id_block" + coor
// console.log("relId :" + relId);
// //console.log("relId :" + relId);
// this.$setBackgroundColor(relId, 0x00ff00);
// // this.$setPos(relId, gridX * 32, gridY * 32); // 确保位置正确
// },
refChannleDivColor: function (coor) {
var relId = "id_block" + coor;
console.log("refDivColor - relId: " + relId);
//console.log("refDivColor - relId: " + relId);
if (document.getElementById(relId)) {
console.log("Element found: " + relId);
//console.log("Element found: " + relId);
this.$setBackgroundColor(relId, 0xFFFFFF);
} else {
console.log("Element not found: " + relId);
//console.log("Element not found: " + relId);
}
},
refDivColor: function (coor) {
var relId = "id_block" + coor;
console.log("refDivColor - relId: " + relId);
//console.log("refDivColor - relId: " + relId);
if (document.getElementById(relId)) {
console.log("Element found: " + relId);
//console.log("Element found: " + relId);
this.$setBackgroundColor(relId, 0x00ff00);
} else {
console.log("Element not found: " + relId);
//console.log("Element not found: " + relId);
}
},
onmousemove: function (gx, gy, topNode, x, y) {
console.log("onmousemove--->gx:" + gx + " gy:" + gy);
//console.log("onmousemove--->gx:" + gx + " gy:" + gy);
if (gx > 480 || gy > 480)
return;
......@@ -198,7 +198,7 @@
},
touchedScreen: function (node, topNode, x, y) {
console.log("X:" + x + " Y:" + y);
//console.log("X:" + x + " Y:" + y);
// this.$enableMouseMoveEvent(true);
},
releasedScreen: function (node, topNode, x, y) {
......
......@@ -66,7 +66,7 @@
onInit() {
},
InterValTime: function () {
console.log("sendValue:" + sendValue);
//console.log("sendValue:" + sendValue);
sendValue += 1;
packet_cmd.pack_cmd_packet_0x50();
this.sendCommValueText = "" + sendValue;
......@@ -89,7 +89,7 @@
var process = require("@system.process")
if (process.platform != "win32") {
serialManager.open(serialPortName, function (isSuccess, status) {
console.log("=========open_async [".concat(isSuccess, "] [").concat(status, "]========="));
//console.log("=========open_async [".concat(isSuccess, "] [").concat(status, "]========="));
});
}
},
......@@ -100,11 +100,11 @@
},
onHide: function () {
console.log(this.$uri + "===========onHide=============");
//console.log(this.$uri + "===========onHide=============");
this.clearTimer();
},
onQuit: function () {
console.log(this.$uri + "===========onQuit=============");
//console.log(this.$uri + "===========onQuit=============");
this.clearTimer();
},
clearTimer: function () {
......@@ -117,7 +117,7 @@
userData.factoryRecvCnt = 0;
var yesJumpPage = require("factoryYesJumpPage.js");
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestUartComm);")
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestUartComm);")
yesJumpPage.yesGoToNextPage("factoryTestUartComm");
},
touchedNGButton: function (node, topNode, x, y) {
......@@ -134,7 +134,7 @@
movePage: function (oldPage, newPage) {
console.log(oldPage + "==========to==========" + newPage);
//console.log(oldPage + "==========to==========" + newPage);
this.$hide(oldPage); // 跳转页面之前立即关掉toast
this.$setY(oldPage, -480); // hide
this.$show(newPage)
......
This diff is collapsed.
......@@ -167,12 +167,12 @@
},
onHide: function () {
console.log(this.$uri + "===========onHide=============");
//console.log(this.$uri + "===========onHide=============");
this.clearTimer();
},
onQuit: function () {
console.log(this.$uri + "===========onQuit=============");
//console.log(this.$uri + "===========onQuit=============");
this.clearTimer();
},
clearTimer: function () {
......@@ -226,10 +226,10 @@
//添加检查全绿为测试功能
globalThis.factoryTest.systemCheck = this.factoryTestSystemCheck;
console.log("=====globalThis.factoryTest.systemCheck:"+globalThis.factoryTest.systemCheck);
//console.log("=====globalThis.factoryTest.systemCheck:"+globalThis.factoryTest.systemCheck);
var yesJumpPage = require("factoryYesJumpPage.js");
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestsystemCheck);")
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestsystemCheck);")
yesJumpPage.yesGoToNextPage("factoryTestsystemCheck");
},
......@@ -257,7 +257,7 @@
},
movePage: function (oldPage, newPage) {
console.log(oldPage + "==========to==========" + newPage);
//console.log(oldPage + "==========to==========" + newPage);
this.$hide(oldPage); // 跳转页面之前立即关掉toast
this.$setY(oldPage, -480); // hide
this.$show(newPage)
......
......@@ -200,8 +200,8 @@
var sysVersion = "The code has been annotated"
// var appVersion = userData.softwareVersion;
var appVersion = "The code has been annotated"
console.log("sysVersion=" + sysVersion);
console.log("appVersion=" + appVersion);
//console.log("sysVersion=" + sysVersion);
//console.log("appVersion=" + appVersion);
//this.crtSNValue = sysVersion + "-" + appVersion;
this.crtSNValue = userData.aboutSNValue || "NG"
......@@ -216,29 +216,29 @@
if (this.onlyOnceFlag == 0) {
var obj = file.read("product_res.json", "json");
if (obj == undefined) {
console.log("product_res.json is not exist,creat it!");
//console.log("product_res.json is not exist,creat it!");
file.create("product_res.json");
this.saveValue();
return;
}
console.log("product_res.json is exist,continue!");
//console.log("product_res.json is exist,continue!");
this.restoreFactoryTestValues(obj);
this.onlyOnceFlag = 1;
}
console.log("save data to product_res.json!");
//console.log("save data to product_res.json!");
this.saveValue();
},
onShow: function () {
console.log(this.$uri + "===========onShow=============");
//console.log(this.$uri + "===========onShow=============");
if (userData.factoryFlag != 1) {
userData.factoryFlag = 1;
}
console.log("wifiEventJS.enableWLANScanValue()================================================1");
//console.log("wifiEventJS.enableWLANScanValue()================================================1");
if (onestart) {
var wifiEventJS = require("factory_testWifi.js");
wifiEventJS.enableWLANScanValue();
console.log("wifiEventJS.enableWLANScanValue()================================================2");
//console.log("wifiEventJS.enableWLANScanValue()================================================2");
onestart = 0;
}
var process = require("@system.process")
......@@ -273,11 +273,11 @@
onHide: function () {
console.log(this.$uri + "===========onHide=============");
//console.log(this.$uri + "===========onHide=============");
this.clearTimer();
},
onQuit: function () {
console.log(this.$uri + "===========onQuit=============");
//console.log(this.$uri + "===========onQuit=============");
this.clearTimer();
},
......@@ -299,9 +299,9 @@
/*************** work ***************/
touchedBlock: function (node, topnode, x, y) {
console.log("X:" + x + " Y:" + y);
//console.log("X:" + x + " Y:" + y);
var url = this.$eval(topnode, ":url");
console.log("===============url:" + url + "=============== topnode:" + topnode);
//console.log("===============url:" + url + "=============== topnode:" + topnode);
if (url == undefined) return;
var en = parseInt(this.$eval(topnode, ":ena"));
......@@ -310,16 +310,17 @@
}
if (url == "factoryTestClearAll") {
this.clearValue()
console.log("==============factoryTestClearAll================");
//console.log("==============factoryTestClearAll================");
this.initShow();
return;
}
if (url == "factoryTestStart") {
console.log("==============factoryTestStart================");
//console.log("==============factoryTestStart================");
url = "factoryTestColor";
}
if(url == "factoryTestExit"){
var systemCtrl = require("systemCtrl.js");
userData.factoryFlag = 0;
systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/runFactory.sh 0");
}
router.push({
......@@ -328,7 +329,7 @@
},
blockColorChange: function (relId, val) {
console.log("relId:" + relId + " val:" + val);
//console.log("relId:" + relId + " val:" + val);
const colors = [0x9E9E9E, 0x4CB050, 0xF44236];
this.$setBackgroundColor(relId, colors[Math.min(val, 2)]);
},
......@@ -404,7 +405,7 @@
console.log(saveObj);
//console.log(saveObj);
file.write("product_res.json", saveObj);
// libwifi.syncSave("save");
},
......@@ -424,7 +425,7 @@
// pcba: globalThis.factoryTest.pcba,
start: globalThis.factoryTest.start,
};
console.log(saveObj);
//console.log(saveObj);
file.write("product_res.json", saveObj);
// libwifi.syncSave("save");
},
......
......@@ -185,10 +185,10 @@ function OZ(target, opacityKeyFrame, zoomKeyFrame, duration, delay, timing_funct
/******************************/
function freeuse_1(target, KeyFrame, timeKeyFrame, timing_function, count, direction, callback, area) {
/*console.log(ShowLog);
/*//console.log(ShowLog);
if (ShowLog)
{
console.log(target + " will use " + KeyFrame[0] + " from " + KeyFrame[1] + " to " + KeyFrame[2] + ",keep " + timeKeyFrame[0] + "ms and delay " + timeKeyFrame[1] + "ms,by " +
//console.log(target + " will use " + KeyFrame[0] + " from " + KeyFrame[1] + " to " + KeyFrame[2] + ",keep " + timeKeyFrame[0] + "ms and delay " + timeKeyFrame[1] + "ms,by " +
timing_function + " loop " + count + " times on " + direction + " direction,handle the " + callback + ".");
}*/
area.$anime({
......
......@@ -8,7 +8,7 @@ function commonInitPage(obj) {
that = obj;
}
function movePage (newPage) {
console.log(that.activePage + "==========to==========" + newPage);
//console.log(that.activePage + "==========to==========" + newPage);
that.$hide(that.activePage); // 跳转页面之前立即关掉toast
that.$setY(that.activePage, -480); // hide
that.$show(newPage)
......
......@@ -3,18 +3,18 @@ var _userdata = require("userdata.js");
var userData = _userdata.userData;
var router = require("@system.router");
var appItem = [];
console.log("===============factoryYesJumpPage==============");
//console.log("===============factoryYesJumpPage==============");
function initPage(pageAppItem) {
userData.factoryappItem = pageAppItem;
// console.log("Initialized appItem data: " + appItem);
// console.log("=============================");
// console.log("Initialized appItem data: " + appItem[1].index);
// //console.log("Initialized appItem data: " + appItem);
// //console.log("=============================");
// //console.log("Initialized appItem data: " + appItem[1].index);
}
function testCode(that){
var activePage = that.activePage
console.log("=======================================activePage: " + activePage)
//console.log("=======================================activePage: " + activePage)
}
function yesGoToNextPage(currentPageName) {
......@@ -22,20 +22,20 @@ function yesGoToNextPage(currentPageName) {
// 找到当前页面对应的 appItem
const currentApp = userData.factoryappItem.find(item => item.startup === currentPageName);
if (!currentApp) {
console.log("Current page not found in appItem.");
//console.log("Current page not found in appItem.");
router.push({ path: "factory_testList" });
return;
}
console.log("Current appItem: " + currentPageName);
console.log("appItem", userData.factoryappItem);
//console.log("Current appItem: " + currentPageName);
//console.log("appItem", userData.factoryappItem);
const currentIndex = currentApp.index;
console.log("Current index: " + currentIndex);
//console.log("Current index: " + currentIndex);
// 如果当前 index 为 0,直接返回 factory_testList
if (currentIndex === 0) {
console.log("Current item has index 0, no navigation.");
//console.log("Current item has index 0, no navigation.");
router.push({ path: "factory_testList" });
return;
}
......@@ -62,7 +62,7 @@ function yesGoToNextPage(currentPageName) {
path: nextApp.startup
});
} else {
console.log("No next enabled test item found by increasing index.");
//console.log("No next enabled test item found by increasing index.");
router.push({ path: "factory_testList" });
}
// } catch (error) {
......
......@@ -41,17 +41,17 @@ function create(name) {
egenmd5.update("/mnt/userdataB/files", "/mnt/userdataB/userdata.md5");
}
if (ret == 0) {
console.log(name + " Created Successfully.")
//console.log(name + " Created Successfully.")
} else {
console.log(name + " Created Failed")
console.log("create ErrorCode:" + ret)
//console.log(name + " Created Failed")
//console.log("create ErrorCode:" + ret)
}
}
function write(name, obj) {
var fs = require("@system.fs")
// 新增参数校验逻辑
if (typeof obj === 'undefined' || obj === null || obj === "") {
console.log("Error: Invalid input object");
//console.log("Error: Invalid input object");
return;
}
let tempStr;
......@@ -61,12 +61,12 @@ function write(name, obj) {
try {
tempStr = JSON.stringify(obj);
} catch (e) {
console.log("Error: Object serialization failed");
//console.log("Error: Object serialization failed");
return;
}
}
// console.log(obj)
// //console.log(obj)
// 获取文件名
var filenm = getFileName(name)
......@@ -91,10 +91,10 @@ function write(name, obj) {
}
if (ret == 0) {
console.log(name + " write Successfully.")
//console.log(name + " write Successfully.")
} else {
console.log(name + " write Failed")
console.log("write ErrorCode:" + ret)
//console.log(name + " write Failed")
//console.log("write ErrorCode:" + ret)
}
}
......@@ -108,7 +108,7 @@ function check(name, obj) {
var partFilePath = "../../../../../mnt/userdataA/files/" + filenm
}
if (fs.exists(partFilePath)) {
console.log("the " + name + " is exists.")
//console.log("the " + name + " is exists.")
return 0
} else {
return -1
......@@ -116,7 +116,7 @@ function check(name, obj) {
}
function read(name, mode) {
var fs = require("@system.fs")
console.log("In Read function name is :" + name)
//console.log("In Read function name is :" + name)
var filenm = getFileName(name)
//构造相对路径
if (process.platform == "win32") {
......@@ -128,7 +128,7 @@ function read(name, mode) {
if (check(partFilePath)) {
return undefined
}
console.log("In Read function path is :" + partFilePath);
//console.log("In Read function path is :" + partFilePath);
if (mode == "json") {
var ret = fs.readFile(partFilePath, "r")
var data = JSON.parse(ret)
......@@ -136,14 +136,14 @@ function read(name, mode) {
var ret = fs.readFile(partFilePath, "rb")
var data = ret
}
console.log(data)
//console.log(data)
return data
}
function checkBasicPath(name, obj) {
var fs = require("@system.fs")
if (fs.exists(name)) {
console.log("the " + name + " is exists.")
//console.log("the " + name + " is exists.")
return 0
} else {
return -1
......@@ -152,9 +152,9 @@ function checkBasicPath(name, obj) {
function readBasicPath(name, mode) {
var fs = require("@system.fs")
console.log("In readBasicPath name = " + name)
console.log("In readBasicPath mode = " + mode)
console.log("In readBasicPath checkBasicPath(name) = " + checkBasicPath(name))
//console.log("In readBasicPath name = " + name)
//console.log("In readBasicPath mode = " + mode)
//console.log("In readBasicPath checkBasicPath(name) = " + checkBasicPath(name))
if (checkBasicPath(name)) {
return undefined
}
......
......@@ -57,8 +57,8 @@ function setTextColorByValue(that, fullKey, value) {
if (value === "NG") ngCount++;
// 3. 等所有项都检测完再写全局变量
console.log("textValueKeys.length: " + textValueKeys.length + ", checkedCount: " + checkedCount + ", ngCount: " + ngCount)
console.log("factoryTestSystemCheck: " + that.factoryTestSystemCheck)
//console.log("textValueKeys.length: " + textValueKeys.length + ", checkedCount: " + checkedCount + ", ngCount: " + ngCount)
//console.log("factoryTestSystemCheck: " + that.factoryTestSystemCheck)
if (checkedCount === textValueKeys.length) {
that.factoryTestSystemCheck = (ngCount === 0) ? 1 : 2;
......@@ -181,7 +181,7 @@ function startSystemInfoTimer(obj) {
systemInfoTimer = setInterval(() => {
updateSystemInfo();
}, 5000);
console.log("系统信息定时器已启动(5000ms)");
//console.log("系统信息定时器已启动(5000ms)");
}
// 停止定时器
......@@ -189,9 +189,9 @@ function stopSystemInfoTimer() {
if (systemInfoTimer) {
clearInterval(systemInfoTimer);
systemInfoTimer = null;
console.log("系统信息定时器已停止");
//console.log("系统信息定时器已停止");
} else {
console.log("定时器未启动");
//console.log("定时器未启动");
}
}
......@@ -271,15 +271,15 @@ function getTotalStorageInfo() {
totalAvailableMB += convertToMB(available);
}
// console.log(`总容量: ${totalSizeMB.toFixed(2)} MB`);
// console.log(`总剩余空间: ${totalAvailableMB.toFixed(2)} MB`);
// //console.log(`总容量: ${totalSizeMB.toFixed(2)} MB`);
// //console.log(`总剩余空间: ${totalAvailableMB.toFixed(2)} MB`);
return {
totalSizeMB: totalSizeMB.toFixed(2),
totalAvailableMB: totalAvailableMB.toFixed(2)
};
} else {
// console.log("无法读取存储信息");
// //console.log("无法读取存储信息");
return {
totalSizeMB: "NG",
totalAvailableMB: "NG"
......@@ -308,10 +308,10 @@ function getCPUTemperature() {
const tempStr = fs.read("/tmp/cpu_temp.txt", "r");
if (tempStr) {
const tempC = parseInt(tempStr.trim()) / 1000;
// console.log(`CPU温度: ${tempC.toFixed(2)} ℃`);
// //console.log(`CPU温度: ${tempC.toFixed(2)} ℃`);
return tempC.toFixed(2);
} else {
// console.log("无法读取CPU温度");
// //console.log("无法读取CPU温度");
return "NG";
}
}
......@@ -324,10 +324,10 @@ function getCPUFrequency() {
const freqStr = fs.read("/tmp/cpu_freq.txt", "r");
if (freqStr) {
const freqMHz = parseInt(freqStr.trim()) / 1000;
// console.log(`CPU频率: ${freqMHz.toFixed(0)} MHz`);
// //console.log(`CPU频率: ${freqMHz.toFixed(0)} MHz`);
return freqMHz.toFixed(0);
} else {
// console.log("无法读取CPU频率");
// //console.log("无法读取CPU频率");
return "NG";
}
}
......@@ -345,7 +345,7 @@ function checkLicense() {
var filenm = "operation_license"
var partFilePath = "../../../../../mnt/extsd/msdkFiles/" + filenm
if (fs.exists(partFilePath)) {
console.log("the " + filenm + " is exists.")
//console.log("the " + filenm + " is exists.")
return 1;
// return "已注册!";
}
......
This diff is collapsed.
......@@ -32,7 +32,7 @@ function getCurrentTime() {
// if (dateT.getUTCHours() < 10) hourdata = "0" + dateT.getUTCHours();
// else if (dateT.getUTCHours() >= 10 && dateT.getUTCHours() <= 24)
// hourdata = dateT.getUTCHours();
console.log("hour=" + dateT.getHours());
//console.log("hour=" + dateT.getHours());
hourdata = dateT.getHours().toString().padStart(2, "0");
if (dateT.getMinutes() < 10) minutedata = "0" + dateT.getMinutes();
......@@ -45,10 +45,10 @@ function getCurrentTime() {
var tempstr2 = "";
// tempstr2 = hourdata + ":" + minutedata;
tempstr2 = hourdata + ":" + minutedata + ":" + secondData;
// console.log("tempstr1=" + tempstr1);
// console.log("tempstr2=" + tempstr2);
// //console.log("tempstr1=" + tempstr1);
// //console.log("tempstr2=" + tempstr2);
tempstr1 = tempstr1 + " " + tempstr2;
// console.log("tempstr1+tempstr2=" + tempstr1);
// //console.log("tempstr1+tempstr2=" + tempstr1);
//更新时间字符串
var obj = {
// "dataHours": dataHours,
......@@ -63,7 +63,7 @@ function getCurrentTime() {
return tempstr1;
}
// console.log(getCurrentTime());
// //console.log(getCurrentTime());
function setCurrentTime(obj) {
//设置当前时间
......
......@@ -13,7 +13,7 @@ function getFactoryFullPath() {
case 1:
return "/mnt/app/quicknode/tests/re860_factory/";
default:
console.log("getFactoryFullPath: env error");
//console.log("getFactoryFullPath: env error");
return "/mnt/app/quicknode/tests/re860_factory/";
}
}
......
......@@ -18,7 +18,7 @@ function checkKeypad() {
activeScreen()
keyValue = keypadAction
if (keypadAction != 0) {
console.log("keypadAction:" + keypadAction);
//console.log("keypadAction:" + keypadAction);
doKeyPadMatter(keypadAction);
}
//end
......@@ -28,7 +28,7 @@ function activeScreen() {
longTimeNop = crtTime
}
function checkLongTimeNop() {
// console.log("crtTime=" + crtTime + " longTimeNop=" + longTimeNop)
// //console.log("crtTime=" + crtTime + " longTimeNop=" + longTimeNop)
if (crtTime - longTimeNop > longTimeNopMax) {
globalThis.eventEmitter.emit("logicLongTimeNop", "logic-checkLongTimeNop");
}
......@@ -44,17 +44,17 @@ function doKeyPadMatter(keyValue) {
switch (keyValue) {
case 13: {
globalThis.eventEmitter.emit("logicKeypadTouched1", "logic-doKeyPadMatter");
console.log("No.1 has been pressed.")
//console.log("No.1 has been pressed.")
break;
}
case 15: {
globalThis.eventEmitter.emit("logicKeypadTouched2", "logic-doKeyPadMatter");
console.log("No.2 has been pressed.")
//console.log("No.2 has been pressed.")
break;
}
case 17: {
globalThis.eventEmitter.emit("logicKeypadTouched3", "logic-doKeyPadMatter");
console.log("No.3 has been pressed.")
//console.log("No.3 has been pressed.")
break;
}
default:
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["changeBgLight", "iii"],
];
console.log("in factory_bglight.js")
//console.log("in factory_bglight.js")
function register() {
console.log("will register bglight.so")
//console.log("will register bglight.so")
var isSuccess = dlfcn.register("@native.bglight", "./lib/factory/bglight.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var bglight = require("@native.bglight");
return bglight
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
var bglight = register();
function changeBgLight(value) {
console.log("Change the screen bglight to the highest!")
//console.log("Change the screen bglight to the highest!")
// bglight.changeBgLight(2, value)
}
......@@ -32,7 +32,7 @@ function changeBgLight(value) {
// bglight.pwmInit()
// }
// function pwm(val) {
// console.log("pwm:" + val)
// //console.log("pwm:" + val)
// if (globalThis.Simu.En == 1) {
// return 0
// }
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["get_ble_mac_address", "ss"],
];
console.log("in factory_bleInfo.js")
//console.log("in factory_bleInfo.js")
function register() {
console.log("will register test_ble.so")
//console.log("will register test_ble.so")
var isSuccess = dlfcn.register("@native.test_ble", "./lib/factory/test_ble.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var test_ble = require("@native.test_ble");
return test_ble
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......@@ -24,15 +24,15 @@ function read(option) {
// option -> "mac" // return "78:22:88:7B:65:3F"
// option -> "qos" // return "11"
// return test_ble.read(option);
console.log("will read ble info")
//console.log("will read ble info")
var mac = undefined;
try {
mac = test_ble.get_ble_mac_address();
} catch (e) {
mac = undefined
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
// console.log("mac: " + mac)
// //console.log("mac: " + mac)
return mac;
}
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn);
//console.log(dlfcn);
var funcs = [["generate_md5_for_directory", "vss"]];
console.log("in factory_egenmd5.js");
//console.log("in factory_egenmd5.js");
function register() {
console.log("will register saveData process.platform=" + process.platform)
//console.log("will register saveData process.platform=" + process.platform)
if (process.platform == "win32") {
console.log("***will register win32_register_func*****")
//console.log("***will register win32_register_func*****")
const Win32RegFunc = require("win32_register_func.js").Win32RegFunc;
var win32Reg = new Win32RegFunc(funcs);
return win32Reg;
}
console.log("will register egenmd5.so");
//console.log("will register egenmd5.so");
var isSuccess = dlfcn.register(
"@native.egenmd5",
"./lib/factory/egenmd5.so",
funcs
);
if (isSuccess) {
console.log("load so successfully");
//console.log("load so successfully");
var egenmd5 = require("@native.egenmd5");
return egenmd5;
} else {
console.log("load so failed");
//console.log("load so failed");
}
return undefined;
}
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["get_modem_signal", "ss"],
......@@ -7,16 +7,16 @@ var funcs = [
["get_modem_imei", "ss"],
];
console.log("in factory_esim.js")
//console.log("in factory_esim.js")
function register() {
console.log("will register test_modem.so")
//console.log("will register test_modem.so")
var isSuccess = dlfcn.register("@native.test_modem", "./lib/factory/test_modem.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var test_modem = require("@native.test_modem");
return test_modem
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......@@ -32,7 +32,7 @@ function read(option) {
value = test_modem.get_modem_signal();
} catch (e) {
value = undefined
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
break;
case "iccid":
......@@ -40,7 +40,7 @@ function read(option) {
value = test_modem.get_modem_iccid();
} catch (e) {
value = undefined
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
break;
case "imei":
......@@ -48,15 +48,15 @@ function read(option) {
value = test_modem.get_modem_imei();
} catch (e) {
value = undefined
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
break;
default:
break;
}
console.log("....");
console.log("============" + "read" + option + "/// value:" + value + "============");
console.log("....");
//console.log("....");
//console.log("============" + "read" + option + "/// value:" + value + "============");
//console.log("....");
return value;
}
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["startFiveInch", "v"],
......@@ -7,16 +7,16 @@ var funcs = [
["read", "is"],
];
console.log("in factory_fiveInch.js")
//console.log("in factory_fiveInch.js")
function register() {
console.log("will register fiveInch.so")
//console.log("will register fiveInch.so")
var isSuccess = dlfcn.register("@native.fiveInch", "./lib/factory/fiveInch.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var fiveInch = require("@native.fiveInch");
return fiveInch
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["soundInit", "v"],
["soundOn", "v"],
......@@ -37,19 +37,19 @@ var funcs = [
["gpioInit", "v"],
];
console.log("in factory_rd190_factory.js")
//console.log("in factory_rd190_factory.js")
function register() {
console.log("will register rd190_factory.so")
//console.log("will register rd190_factory.so")
if (globalThis.Simu.En == 1) {
return undefined
}
var isSuccess = dlfcn.register("@native.rd190_factory", "./lib/factory/rd190_factory.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var rd190_factory = require("@native.rd190_factory");
return rd190_factory
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......@@ -76,7 +76,7 @@ function soundOn() {
rd190_factory.soundOn()
}
function pwm(val) {
console.log("pwm:" + val)
//console.log("pwm:" + val)
if (globalThis.Simu.En == 1) {
return 0
}
......@@ -109,8 +109,8 @@ function pwm(val) {
}
}
function gpio(index, status) {
console.log("index:" + index)
console.log("status:" + status)
//console.log("index:" + index)
//console.log("status:" + status)
if (globalThis.Simu.En == 1) {
return 0
}
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["set", "viiiiii"],
["isRTC", "is"],
];
console.log("in factory_rtc.js")
//console.log("in factory_rtc.js")
function register() {
console.log("will register rtc.so")
//console.log("will register rtc.so")
var isSuccess = dlfcn.register("@native.rtc", "./lib/factory/rtc.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var rtc = require("@native.rtc");
return rtc
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......@@ -33,7 +33,7 @@ function ctrl(word, obj) {
break
}
default: {
console.log("ERROR:rtc ctrl word undefined..")
//console.log("ERROR:rtc ctrl word undefined..")
}
}
}
......@@ -45,14 +45,14 @@ function getrtc(word) {
ret = rtc.isRTC("rtc1")
} catch (e) {
ret = 0
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
console.log(ret);
//console.log(ret);
return ret
// break
}
default: {
console.log("ERROR:rtc getRTC word undefined..")
//console.log("ERROR:rtc getRTC word undefined..")
}
}
}
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["executeSync", "vi"],
......@@ -14,26 +14,26 @@ var funcs = [
["executePrint", "is"],
];
console.log("in systemCtrl.js")
//console.log("in systemCtrl.js")
function register() {
if (globalThis.$simulatorFlag == true) {
return undefined
}
var process = require("@system.process")
if (process.platform == "win32") {
console.log("***will register win32_register_func*****")
//console.log("***will register win32_register_func*****")
const Win32RegFunc = require("win32_register_func.js").Win32RegFunc;
var win32Reg = new Win32RegFunc(funcs);
return win32Reg;
}
console.log("will register systemCtrl.so")
//console.log("will register systemCtrl.so")
var isSuccess = dlfcn.register("@native.systemCtrl", "./lib/factory/systemCtrl.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var systemCtrl = require("@native.systemCtrl");
return systemCtrl
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......@@ -44,10 +44,10 @@ function sync(value) {
}
function findSwuFile(value) {
console.log("There are in findSwuFile function! ");
//console.log("There are in findSwuFile function! ");
var findSwuFlag = 0;
findSwuFlag = systemCtrl.findSwuFile(value);
console.log("findSwuFlag=" + findSwuFlag);
//console.log("findSwuFlag=" + findSwuFlag);
return findSwuFlag;
}
......@@ -57,41 +57,41 @@ function executeSwuUpdate(value1, value2) {
if ((value1 == 1 || value1 == 0) && (value2 == 1)) {
updateFlag = systemCtrl.executeUpdate(value1);
}
console.log("updateFlag=" + updateFlag);
//console.log("updateFlag=" + updateFlag);
}
function executeSystemCommand(cmd) {
var executeFlag = systemCtrl.executeSystemCommand(cmd);
// console.log("executeFlag=" + executeFlag);
// //console.log("executeFlag=" + executeFlag);
// if (executeFlag == -1) {
// console.log("executeSystemCommand failed!");
// //console.log("executeSystemCommand failed!");
// }
// else {
// console.log("executeSystemCommand success!");
// //console.log("executeSystemCommand success!");
// }
}
function executePrint(str) {
console.log("There are in executePrint function! ");
//console.log("There are in executePrint function! ");
var executeFlag = systemCtrl.executePrint(str);
}
function systemReboot(value) {
systemCtrl.systemReboot(value);
console.log("There are in systemReboot function! ");
//console.log("There are in systemReboot function! ");
}
function checkPartition(value) {
console.log("There are in checkPartition function! ");
//console.log("There are in checkPartition function! ");
var checkValue = systemCtrl.checkPartition(value);
console.log("checkValue=" + checkValue);
//console.log("checkValue=" + checkValue);
return checkValue;
}
function systemMain(value) {
systemCtrl.systemMain(value);
console.log("There are in systemMain function! ");
//console.log("There are in systemMain function! ");
}
module.exports = {
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["startlte", "v"],
......@@ -7,16 +7,16 @@ var funcs = [
["read", "is"],
];
console.log("in factory_testlte.js")
//console.log("in factory_testlte.js")
function register() {
console.log("will register lte.so")
//console.log("will register lte.so")
var isSuccess = dlfcn.register("@native.lte", "./lib/factory/lte.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var lte = require("@native.lte");
return lte
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......
var dlfcn = require("dlfcna.js");
console.log(dlfcn)
//console.log(dlfcn)
var funcs = [
["isWifi", "is"],
......@@ -10,16 +10,16 @@ var funcs = [
["get_wifi_mac", "ss"],
];
console.log("in factory_wifi.js")
//console.log("in factory_wifi.js")
function register() {
console.log("will register testWifi.so")
//console.log("will register testWifi.so")
var isSuccess = dlfcn.register("@native.wifi", "./lib/factory/testWifi.so", funcs);
if (isSuccess) {
console.log("load so successfully")
//console.log("load so successfully")
var wifi = require("@native.wifi");
return wifi
} else {
console.log("load so failed")
//console.log("load so failed")
}
return undefined;
}
......@@ -33,9 +33,9 @@ function testWifiConnect(word, SSID) {
ret = wifi.isWifi(SSID);
} catch (e) {
ret = 0
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
console.log("ret[0]=" + ret);
//console.log("ret[0]=" + ret);
return ret;
}
case "getSignal": {
......@@ -44,28 +44,28 @@ function testWifiConnect(word, SSID) {
ret = wifi.getWifiSignalLevel("signal");
} catch (e) {
ret = -999
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
console.log("ret[1]=" + ret);
//console.log("ret[1]=" + ret);
return ret;
}
default: {
console.log("ERROR:wifi testWifiConnect word undefined..")
//console.log("ERROR:wifi testWifiConnect word undefined..")
}
}
}
function initWifiTest(word) {
console.log("start run initWifiTest function");
//console.log("start run initWifiTest function");
switch (word) {
case "init": {
var ret = wifi.initWifi(word);
console.log(ret);
//console.log(ret);
return ret
// break
}
default: {
console.log("ERROR:wifi initTest word undefined..")
//console.log("ERROR:wifi initTest word undefined..")
}
}
}
......@@ -78,14 +78,14 @@ function getSysVersion(word) {
ret = wifi.getVersion(word);
} catch (e) {
ret = "1.0.0"
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
console.log("ret=" + ret);
//console.log("ret=" + ret);
return ret
// break
}
default: {
console.log("ERROR:wifi getSysVersion word undefined..")
//console.log("ERROR:wifi getSysVersion word undefined..")
}
}
}
......@@ -98,26 +98,26 @@ function syncSave(word) {
ret = wifi.syncSave(word);
} catch (e) {
ret = 1
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
console.log("ret=" + ret);
//console.log("ret=" + ret);
return ret
}
default: {
console.log("ERROR:wifi getSysVersion word undefined..")
//console.log("ERROR:wifi getSysVersion word undefined..")
}
}
}
function getWifiMac() {
console.log("getWifiMac///////////////////////////////////////////");
//console.log("getWifiMac///////////////////////////////////////////");
var mac = undefined
try {
mac = wifi.get_wifi_mac();
} catch (e) {
mac = "00:11:22:33:44:55"
console.log("!!!ERROR:" + e)
//console.log("!!!ERROR:" + e)
}
console.log("mac=" + mac);
//console.log("mac=" + mac);
return mac;
}
......
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