Commit 8700e8c9 authored by waterword's avatar waterword

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

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