Commit d487a615 authored by lyong's avatar lyong

fix:自动化测试启动方式

parent d91da11c
// globalThis.cslog = //console.log
console.log = function () {
}
console.trace = function () {
}
console.debug = function (text) {
var date = new Date()
text = `========= [${date}] ${text}`
print(text)
}
function initEventLister() {
var EventEmitter = require('@system.events');
globalThis.eventEmitter = new EventEmitter();
}
function onCreate(uri) {
var re860_router = require("router-re860.js").router;
re860_router.onClick = function (node, topNode, x, y) {
var systemCtrl = require("systemCtrl.js");
systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/eAplay.sh /mnt/app/voice_click.wav");
}
initEventLister();
globalThis.Simu = {
"En": 0,
}
globalThis.test = {
"En": 0,
}
var process = require("@system.process")
if (process.platform == "win32") {
//console.log("its win32.")
globalThis.Simu.En = 1
}
globalThis.DEV = {
"tpLog": 1,
}
initEventLister();
gc();
//console.log(showMemInfo());
var dom = require("dom.js"); //要放在router后面,router会创建document
var router = re860_router;
var times = [];
if (startUrl() == undefined) {
times.push(clock());
gc();
router.push({ 'path': uri });
times.push(clock());
gc();
} else {
times.push(clock());
var uriObj = JSON.parse(globalThat.$uri);
console.log(uriObj);
router.push(uriObj);
times.push(clock());
console.log(times);
gc();
}
require("factory_autoFactoryTest.js").autoFactoryTestTimer();
}
// function onKeyEvent(code) {
// var router = require("@system.router");
// var keypad = require("keypadCode.js")
// keypad.triggerByCode(code)
// //console.log("++++ CodeNum:" + code)
// return
// if (code == 62) {
// router.pageDebug(!router.debugOn);
// }
// }
function onDestroy() {
// 应用退出时会被触发
var router = require("@system.router");
router.quit();
}
function onGestureEvent(dir, x, y) {
var router = require("@system.router");
var indexObj = router.currentPage.$indexObj;
if (indexObj.hasOwnProperty('onGestureEvent')) {
indexObj.onGestureEvent(dir, x, y);
}
}
function onMoveEvent(globalX, globalY, topObj, x, y) {
if (this.currentPage) {
var indexObj = this.currentPage.$indexObj;
if (indexObj && (indexObj.hasOwnProperty('onmousemove') ||
indexObj.hasOwnProperty('touchmove'))) {
if (indexObj.$onmousemove == undefined) {
if (indexObj.hasOwnProperty('onmousemove')) {
indexObj.$onmousemove = indexObj.onmousemove;
} else if (indexObj.hasOwnProperty('touchmove')) {
indexObj.$onmousemove = indexObj.touchmove;
}
}
if (typeof indexObj.$onmousemove == "function") {
var node = __getElementByObj(indexObj, topObj)
if (node) {
if (indexObj.$onmousemove.length == 1) {
var e = router.toH5Event(node, node, x, y);
indexObj.$onmousemove(e);
return;
}
}
indexObj.$onmousemove(globalX, globalY, topObj, x, y);
}
}
}
}
EvueApp({
// "font": "MideaType-Regular.ttf",
"font": "SimHei_GB2312_80_t.ttf",
// "font": "Metropolis-Medium.ttf",
'onCreate': onCreate,
'onDestroy': onDestroy,
'onMoveEvent': onMoveEvent,
'onGestureEvent': onGestureEvent,
'paths': ["../RD190/", "../../enode_modules/", "./../RE860A/logicJS/", "./../RE860A/common/", "./../RE860A/", "./../re860a-v1.0/", "./../re860a-v1.0/logicJS/", "./../re860a-v1.0/common/", "./factoryTest_plugin/", "./factoryTest_plugin/ref/", "./factoryTestItem/"],
'uri': 'factory_testList',
// 'uri': 'testLongTimeList',
'minFreeJSHeapSize': 200
});
......@@ -246,9 +246,9 @@ function getAutoStartMode() {
return autoMode
}
function initUI(){
function initUI() {
initUI._isInit = false;
if(initUI._isInit == false){
if (initUI._isInit == false) {
setAutoModeUI("INIT");
initUI._isInit = true;
}
......@@ -278,17 +278,13 @@ function setAutoModeUI(mode) {
console.log("111")
that.exitLedTest();
that.onshwKeyBuntton();
that.showButtonUI("show");
break;
that.showButtonUI("show");
break;
case "INIT":
autoMode = mode;
router.push({
path: "factory_autoFactory"
});
require("autoOffScreen.js").onOffAtuoOffScreen();
setBright(100)
var soundLevelText = "tinymix set 16 7"
system(soundLevelText);
break;
default:
......@@ -469,7 +465,12 @@ function devExist(devPath) {
const ret = fs.read(tmpFlag, "r");
return (ret && ret.trim() === "1") ? 1 : 0;
}
function initautoFactorySetting() {
require("autoOffScreen.js").onOffAtuoOffScreen();
// setBright(100)
var soundLevelText = "tinymix set 16 7"
system(soundLevelText);
}
function system(cmd) {
systemCtrl.executeSystemCommand(cmd)
......@@ -502,5 +503,6 @@ module.exports = {
checkUsbDeviceExist: checkUsbDeviceExist,
getRtcTimer: getRtcTimer,
setSsid: setSsid,
getssid: getssid
getssid: getssid,
initautoFactorySetting: initautoFactorySetting
}
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