Commit 4a6d1a08 authored by lyong's avatar lyong

fix:优化自动化测试

parent c93b03fb
...@@ -83,12 +83,24 @@ ...@@ -83,12 +83,24 @@
this.gifIconSrc = " "; this.gifIconSrc = " ";
this.$hide("id_testPng") this.$hide("id_testPng")
this.checkFlagBash(0) this.checkFlagBash(0)
this.$show("id_yes")
this.$show("id_ng")
this.$show("id_back")
autoUtil.initPage(this) autoUtil.initPage(this)
this.showButtonUI("show")
}, },
showButtonUI: function (state) {
if (!this) return;
if (state == "show") {
this.$show("id_yes")
this.$show("id_ng")
this.$show("id_back")
}
if (state == "hide") {
this.$hide("id_yes")
this.$hide("id_ng")
this.$hide("id_back")
}
},
onHide: function () { onHide: function () {
//console.log(this.$uri + "===========onHide=============") //console.log(this.$uri + "===========onHide=============")
......
...@@ -50,9 +50,11 @@ function eventHex(fd, recvBuf) { ...@@ -50,9 +50,11 @@ function eventHex(fd, recvBuf) {
function doStart(fd) { function doStart(fd) {
setCountdownStatus(false); //关闭倒计时直到接到通知关闭 setCountdownStatus(false); //关闭倒计时直到接到通知关闭
send(fd, '+START'); send(fd, '+START');
autoUtil.setAutoModeUI("INIT"); autoUtil.initUI();
// autoUtil.setAutoModeUI("INIT");
} }
function doGetRtc(fd) { function doGetRtc(fd) {
var time = "+" + autoUtil.getRtcTimer() var time = "+" + autoUtil.getRtcTimer()
console.log('RTC:' + time); console.log('RTC:' + time);
...@@ -96,14 +98,20 @@ function doOtg(fd) { ...@@ -96,14 +98,20 @@ function doOtg(fd) {
send(fd, '+FAIL'); send(fd, '+FAIL');
} }
} }
var cntLcd = 0;
function doLcd(fd) { function doLcd(fd) {
cntLcd += 1; if (doLcd.cntLcd == undefined) {
if (cntLcd > 1) { doLcd.cntLcd = 0;
}
doLcd.cntLcd += 1;
console.log("doLcd " + doLcd.cntLcd)
if (doLcd.cntLcd > 1) {
autoUtil.ledTimerOut(); autoUtil.ledTimerOut();
manualLcdBz(); send(fd, '+OK');
doLcd.cntLcd = 0;
} else { } else {
// autoUtil.setAutoModeUI("INIT"); // autoUtil.setAutoModeUI("INIT");
autoUtil.initUI();
autoUtil.setAutoModeUI("LCD"); autoUtil.setAutoModeUI("LCD");
} }
...@@ -174,6 +182,7 @@ function doWriteLic(fd, recvBuf) { ...@@ -174,6 +182,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.setAutoModeUI("TOUCH"); autoUtil.setAutoModeUI("TOUCH");
touchFlag = 1; touchFlag = 1;
// send(fd, '+OK'); // send(fd, '+OK');
...@@ -197,9 +206,6 @@ function manualKeyBz(buf) { ...@@ -197,9 +206,6 @@ function manualKeyBz(buf) {
} }
} }
function manualLcdBz() {
send(getFd(), '+OK');
}
function initEvent(fd) { function initEvent(fd) {
...@@ -457,6 +463,5 @@ function uart_set_mode(fd, mode) { ...@@ -457,6 +463,5 @@ function uart_set_mode(fd, mode) {
module.exports = { module.exports = {
autoFactoryTestTimer: autoFactoryTestTimer, autoFactoryTestTimer: autoFactoryTestTimer,
manualKeyBz: manualKeyBz, manualKeyBz: manualKeyBz,
manualLcdBz: manualLcdBz,
restartUart: restartUart restartUart: restartUart
} }
...@@ -242,8 +242,17 @@ function getAutoStartMode() { ...@@ -242,8 +242,17 @@ function getAutoStartMode() {
return autoMode return autoMode
} }
function initUI(){
initUI._isInit = false;
if(initUI._isInit == false){
setAutoModeUI("INIT");
initUI._isInit = true;
}
}
function initPage(id) { function initPage(id) {
console.log("!!init id:" + id)
that = id; that = id;
} }
function ledTimerOut() { function ledTimerOut() {
...@@ -256,15 +265,16 @@ function setAutoModeUI(mode) { ...@@ -256,15 +265,16 @@ function setAutoModeUI(mode) {
switch (mode) { switch (mode) {
case "LCD": case "LCD":
that.ledtimerSet() that.ledtimerSet()
that.$hide("id_yes") // that.$hide("id_yes")
that.$hide("id_ng") // that.$hide("id_ng")
that.$hide("id_back") // that.$hide("id_back")
that.showButtonUI("hide");
break; break;
case "TOUCH": case "TOUCH":
console.log("111") console.log("111")
that.exitLedTest(); that.exitLedTest();
that.onshwKeyBuntton(); that.onshwKeyBuntton();
console. that.showButtonUI("show");
break; break;
case "INIT": case "INIT":
autoMode = mode; autoMode = mode;
...@@ -477,6 +487,7 @@ module.exports = { ...@@ -477,6 +487,7 @@ module.exports = {
formatHexWithSpace: formatHexWithSpace, formatHexWithSpace: formatHexWithSpace,
initPage: initPage, initPage: initPage,
setAutoModeUI: setAutoModeUI, setAutoModeUI: setAutoModeUI,
initUI: initUI,
ledTimerOut: ledTimerOut, ledTimerOut: ledTimerOut,
exitAutoFactoryPage: exitAutoFactoryPage, exitAutoFactoryPage: exitAutoFactoryPage,
licParce: licParce, licParce: licParce,
......
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