Commit f7e32134 authored by lyong's avatar lyong

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

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