实现方案导入导出,根据选项自动生成文件名
This commit is contained in:
@@ -3,7 +3,7 @@ var fac_bind_run = 0;
|
||||
async function EWRunFire()
|
||||
{
|
||||
|
||||
ShowCommMes("注码脚本加载",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆脚本本加载",MesgType.MESG_TYPE_INFO);
|
||||
fac_bind_init_flag =1;
|
||||
var content_str = '<div class="layui-row" style="line-height: 1.8rem; padding-top: 2px;">';
|
||||
|
||||
@@ -12,9 +12,22 @@ async function EWRunFire()
|
||||
content_str += '</div>'
|
||||
|
||||
content_str += '<div class="layui-col-xs2">'
|
||||
content_str += '<button type="button" class="layui-btn layui-btn-normal plugin_fire_test" style="height: 1.8rem; line-height: 1.8rem;width: 90%;" onclick="Ew_AutoFire()">起爆</button>';
|
||||
content_str += '<button type="button" class="layui-btn layui-btn-normal plugin_fire_test" style="height: 1.8rem; line-height: 1.8rem;width: 90%;" onclick="Ew_AutoFire()">单发起爆</button>';
|
||||
content_str += '</div>'
|
||||
|
||||
content_str += '<div class="layui-col-xs2">'
|
||||
content_str += '<button type="button" class="layui-btn layui-btn-normal plugin_fire_test" style="height: 1.8rem; line-height: 1.8rem;width: 90%;" onclick="Ew_AutoFirePrapare()">组网</button>';
|
||||
content_str += '</div>'
|
||||
|
||||
content_str += '<div class="layui-col-xs2">'
|
||||
content_str += '<button type="button" class="layui-btn layui-btn-normal plugin_fire_test" style="height: 1.8rem; line-height: 1.8rem;width: 90%;" onclick="Ew_MutilFire()">起爆</button>';
|
||||
content_str += '</div>'
|
||||
|
||||
content_str += '<div class="layui-col-xs2">'
|
||||
content_str += '<button type="button" class="layui-btn layui-btn-normal plugin_fire_test" style="height: 1.8rem; line-height: 1.8rem;width: 90%;" onclick="Ew_PowerOnTest()">上电测试</button>';
|
||||
content_str += '</div>'
|
||||
|
||||
|
||||
content_str += '</div>'
|
||||
$("#Oper_View").append(content_str);
|
||||
}
|
||||
@@ -22,7 +35,7 @@ async function EWRunFire()
|
||||
async function Ew_Autobind()
|
||||
{
|
||||
var rtv = 0;
|
||||
epro2_oper.ep2_heartbeat_sw = 0;
|
||||
|
||||
ep2_getInput();
|
||||
epro2_oper.cmd = 13;
|
||||
await Ep2_HeartBeat_SW();
|
||||
@@ -103,5 +116,151 @@ async function Ew_AutoFire()
|
||||
await TransSleep(200);
|
||||
epro2_oper.cmd = 18;
|
||||
await Ep2_Blast();
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("起爆成功",MesgType.MESG_TYPE_INFO);
|
||||
|
||||
await Ep2_BusSwitch(0);
|
||||
}
|
||||
|
||||
var Ew_AutoFire_Flag = 0;
|
||||
async function Ew_AutoFirePrapare()
|
||||
{
|
||||
// var run_counter = 0;
|
||||
// if(Ew_AutoFire_Flag == 0)
|
||||
// {
|
||||
// Ew_AutoFire_Flag = 1;
|
||||
// }else{
|
||||
// Ew_AutoFire_Flag = 0;
|
||||
// return;
|
||||
// }
|
||||
// while(Ew_AutoFire_Flag > 0)
|
||||
// {
|
||||
ep2_getInput();
|
||||
epro2_oper.ep2_high_voltage = 85;
|
||||
epro2_oper.ep2_middle_voltage = 50;
|
||||
await Ep2_BusSwitch(1);
|
||||
await TransSleep(2000);
|
||||
ShowCommMes("快速配置",MesgType.MESG_TYPE_INFO);
|
||||
epro2_oper.cmd = 25;
|
||||
epro2_oper.cycle_test = 1;
|
||||
await Ep2_ExcueOperCmd();
|
||||
|
||||
epro2_oper.ep2_high_voltage = 200;
|
||||
await Ep2_BusSwitch(1);
|
||||
await TransSleep(2000);
|
||||
|
||||
ShowCommMes("充电",MesgType.MESG_TYPE_INFO);
|
||||
epro2_oper.cmd = 17;
|
||||
epro2_oper.cycle_test = 0;
|
||||
await Ep2_ExcueOperCmd();
|
||||
await TransSleep(8000);
|
||||
|
||||
ShowCommMes("使能MTP",MesgType.MESG_TYPE_INFO);
|
||||
epro2_oper.cmd = 29;
|
||||
await Ep2_ExcueOperCmd();
|
||||
await TransSleep(200);
|
||||
|
||||
|
||||
ShowCommMes("校准",MesgType.MESG_TYPE_INFO);
|
||||
epro2_oper.cmd = 7;
|
||||
await Ep2_ExcueOperCmd();
|
||||
await TransSleep(1500);
|
||||
|
||||
ShowCommMes("保持配置",MesgType.MESG_TYPE_INFO);
|
||||
epro2_oper.cmd = 3;
|
||||
await Ep2_ExcueOperCmd();
|
||||
await TransSleep(1000);
|
||||
|
||||
epro2_oper.cmd = 4;
|
||||
await Ep2_ExcueOperCmd();
|
||||
await TransSleep(1000);
|
||||
|
||||
if( typeof(ep2_qthandle) != "undefined" && ep2_qthandle != null )
|
||||
{
|
||||
ep2_qthandle.Ep2_Beep(2);
|
||||
}
|
||||
epro2_oper.cmd = 18;
|
||||
await Ep2_ExcueOperCmd();
|
||||
await Ep2_BusSwitch(0);
|
||||
// await TransSleep(2000);
|
||||
// run_counter++;
|
||||
// ShowCommMes("运行次数 "+run_counter,MesgType.MESG_TYPE_INFO);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
async function Ew_MutilFire()
|
||||
{
|
||||
epro2_oper.cmd = 18;
|
||||
await Ep2_ExcueOperCmd();
|
||||
await Ep2_BusSwitch(0);
|
||||
}
|
||||
var EW_PorwerOnTest_Flag = 0;
|
||||
async function Ew_PowerOnTest()
|
||||
{
|
||||
if(EW_PorwerOnTest_Flag == 0)
|
||||
{
|
||||
EW_PorwerOnTest_Flag = 1;
|
||||
}else{
|
||||
EW_PorwerOnTest_Flag = 0;
|
||||
return;
|
||||
}
|
||||
ep2_getInput();
|
||||
//开心跳
|
||||
|
||||
epro2_oper.ep2_heartbeat_sw = 0;
|
||||
epro2_oper.cmd = 13;
|
||||
await Ep2_HeartBeat_SW();
|
||||
var count = 0;
|
||||
var delay_count = 0;
|
||||
while(count < 1000 && EW_PorwerOnTest_Flag > 0)
|
||||
{
|
||||
count++;
|
||||
//关总线
|
||||
delay_count = 0;
|
||||
epro2_oper.cmd = 16;
|
||||
await Ep2_BusSwitch(0);
|
||||
while(delay_count < 120 && EW_PorwerOnTest_Flag > 0)
|
||||
{
|
||||
await TransSleep(1000);
|
||||
delay_count++;
|
||||
}
|
||||
if(EW_PorwerOnTest_Flag == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
epro2_oper.cmd = 15;
|
||||
await Ep2_BusSwitch(1);//上电
|
||||
delay_count = 0;
|
||||
while(delay_count < 5 && EW_PorwerOnTest_Flag > 0)
|
||||
{
|
||||
await TransSleep(1000);
|
||||
delay_count++;
|
||||
}
|
||||
if(EW_PorwerOnTest_Flag == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(ep2_bus_cur > 12)
|
||||
{
|
||||
ShowCommMes("上电测试失败 "+ count,MesgType.MESG_TYPE_ERROR,1);
|
||||
BTErrorCount(1);
|
||||
break;
|
||||
}else{
|
||||
|
||||
ShowCommMes("上电测试通过 "+ count,MesgType.MESG_TYPE_INFO,1);
|
||||
}
|
||||
}
|
||||
ShowCommMes("上电测试结束 ",MesgType.MESG_TYPE_INFO,1);
|
||||
}
|
||||
Reference in New Issue
Block a user