Commit 4a6d1a08 authored by lyong's avatar lyong

fix:优化自动化测试

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