Commit f7e32134 authored by lyong's avatar lyong

fix:占时优化代码容错,关闭自动化测试

parent 9b37db9c
......@@ -61,7 +61,7 @@ function onCreate(uri) {
gc();
}
require("factory_autoFactoryTest.js").autoFactoryTestTimer();
// require("factory_autoFactoryTest.js").autoFactoryTestTimer();
}
// function onKeyEvent(code) {
......
......@@ -90,9 +90,9 @@
// en: 0,
//},
{
id: "id_factoryTestUartComm",
id: "id_factory_testUartComm",
name: "无极性通信",
startup: "factoryTestUartComm",
startup: "factory_testUartComm",
top: 100,
left: 20,
en: 1,
......
......@@ -63,6 +63,7 @@
//console.log("sendValue:" + sendValue);
sendValue += 1;
packet_cmd.pack_cmd_packet_0x50();
console.log("userData.factoryFlag:" + userData.factoryFlag);
this.sendCommValueText = "" + sendValue;
this.recvCommValueText = "" + userData.factoryRecvCnt;
if (userData.factoryRecvCnt > 0) {
......@@ -70,26 +71,31 @@
this.checkAutoFactory();
}
},
checkAutoFactory: function (node, topNode, x, y) {
checkAutoFactory: function (node, topNode, x, y) {
require("factory_testAuto.js").autoFactoryNextPage("factoryTestUartComm");
},
uartComm: function () {
var serialPortName = undefined
// var serialManager = require("serialmanager.js");
var process = require("@system.process");
if (process.platform == "win32") {
// return;
serialPortName = "COM4"
}
else {
serialPortName = "/dev/ttyProto"
}
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("uartComm");
var timerOutCnt = require("factory_autoFactoryTest.js").exclear2Xuart();
setTimeout(function () {
var serialPortName = undefined
// var serialManager = require("serialmanager.js");
var process = require("@system.process");
if (process.platform == "win32") {
// return;
serialPortName = "COM4"
}
else {
serialPortName = "/dev/ttyProto"
}
var process = require("@system.process")
if (process.platform != "win32") {
serialManager.open(serialPortName, function (isSuccess, status) {
//console.log("=========open_async [".concat(isSuccess, "] [").concat(status, "]========="));
});
}
}, timerOutCnt);
},
onShow: function () {
this.$setY("id_yes", -480);
......
......@@ -8,6 +8,7 @@ var uart = require("factory_uartUtil.js");
var _userdata = require("userdata.js");
var userData = _userdata.userData;
var autoUtil = require("factory_autoFactoryTestUtil.js");
var autoFactoryState = false;
var uartMode = 2 //0:uart 1:uart_carrie_wave
/* ================= 1. 路由表:关键字 → 处理函数 ================= */
......@@ -111,7 +112,7 @@ function doLcd(fd) {
doLcd.cntLcd = 0;
} else {
// autoUtil.setAutoModeUI("INIT");
autoUtil.initUI();
autoUtil.initUI();
autoUtil.setAutoModeUI("LCD");
}
......@@ -182,7 +183,7 @@ function doWriteLic(fd, recvBuf) {
function doKeyBz(fd, recvBuf) {
/* 人工弹窗可接 UI,这里直接返回 OK */
// autoUtil.setAutoModeUI("INIT");
autoUtil.initUI();
autoUtil.initUI();
autoUtil.setAutoModeUI("TOUCH");
touchFlag = 1;
// send(fd, '+OK');
......@@ -381,7 +382,7 @@ function kill_tty(port) {
}
function initCarrieWave(port, baud_str) {
console.log("!!initCarrieWave");
setAutoFactory(true)
uart.pwm_uart_init()
return uart.uart_init(port, baud_str);
......@@ -394,6 +395,7 @@ function close(fd) {
uart.uart_close(fd);
fd = -1;
}
setAutoFactory(false)
}
......@@ -456,12 +458,30 @@ function uart_set_mode(fd, mode) {
}
function setAutoFactory(state) {
autoFactoryState = state;
}
function getAutoFactory(state) {
return autoFactoryState
}
function exclear2Xuart() {
console.log("!!!_exclear2Xuart");
// exitAutoFactory();
// const port = pickUartDev();
// if (!port) return -1;
// return kill_tty(port);
return 1;
// setTimeout(() => {
// }, 1000);
}
module.exports = {
autoFactoryTestTimer: autoFactoryTestTimer,
getAutoFactory: getAutoFactory,
exclear2Xuart: exclear2Xuart,
manualKeyBz: manualKeyBz,
restartUart: restartUart
}
......@@ -16,7 +16,7 @@ var flageMap = {
"factoryTestTouch": "touch",
"factoryTestWifi": "wifi",
"factoryTestSound": "sound",
"factoryTestUartComm": "uartComm",
"factory_testUartComm": "uartComm",
"factoryTestBright": "bright",
"factoryTestLicenseAuthor": "licenseAuthor",
"factoryTestRtc": "rtc",
......@@ -33,7 +33,7 @@ var autoMovePage = [
"factoryTestTouch",
"factoryTestWifi",
"factoryTestSound",
"factoryTestUartComm",
"factory_testUartComm",
"factoryTestBright",
"factoryTestLicenseAuthor",
"factoryTestRtc",
......
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