实现方案导入导出,根据选项自动生成文件名
This commit is contained in:
@@ -4,7 +4,7 @@ var BT_OPER_SENDDATAS = 2;
|
||||
var BT_OPEN_CMD = 1;
|
||||
var BT_CHHOICE_CMD = 2;
|
||||
var BT_BEEP_CMD = 3;
|
||||
var BT_MES_AUTO_CLEAN = 10000;
|
||||
var BT_MES_AUTO_CLEAN = 5000;
|
||||
var bt_mes_count = 0;
|
||||
var BTBtnTask_Busy = 0;
|
||||
var BTMesgBox;
|
||||
|
@@ -344,18 +344,78 @@ EW_ErrorInfo={
|
||||
//错误描述
|
||||
//主错误段
|
||||
MajorErrInfo:[
|
||||
{Info:"执行成功",MajorErrCode:0,SubErrCode:[]},
|
||||
{Info:"检测器异常",MajorErrCode:1,SubErrCode:[21,23,254]},
|
||||
{Info:"主电容异常",MajorErrCode:2,SubErrCode:[30,31,32,33,34,35,42]},
|
||||
{Info:"接触异常",MajorErrCode:3,SubErrCode:[27]},
|
||||
{Info:"桥丝阻值异常",MajorErrCode:4,SubErrCode:[30,41,42,51]},
|
||||
{Info:"芯片异常",MajorErrCode:5,SubErrCode:[22,24,25,26,27,28,29,30,32,33,35,36,37,38,39,40,41,42,43,44,45,52,53,54]},
|
||||
{Info:"判定任务缺失",MajorErrCode:6,SubErrCode:[212]},
|
||||
{Info:"过流",MajorErrCode:7,SubErrCode:[]},
|
||||
{Info:"短路",MajorErrCode:8,SubErrCode:[]},
|
||||
{Info:"未执行槽任务",MajorErrCode:9,SubErrCode:[]},
|
||||
{Info:"槽任务参数错误",MajorErrCode:10,SubErrCode:[]},
|
||||
{Info:"其他异常",MajorErrCode:20,SubErrCode:[255,208,209,210,211,212,213]},
|
||||
{
|
||||
Info:"执行成功",
|
||||
MajorErrCode:0,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"检测器异常",
|
||||
MajorErrCode:1,
|
||||
SubErrCode:[21,23,254],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"主电容异常",
|
||||
MajorErrCode:2,
|
||||
SubErrCode:[30,31,32,33,34,35,42],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"接触异常",
|
||||
MajorErrCode:3,
|
||||
SubErrCode:[27],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"桥丝阻值异常",
|
||||
MajorErrCode:4,
|
||||
SubErrCode:[30,41,42,51],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"芯片异常",
|
||||
MajorErrCode:5,
|
||||
SubErrCode:[22,24,25,26,27,28,29,30,32,33,35,36,37,38,39,40,41,42,43,44,45,52,53,54],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"判定任务缺失",
|
||||
MajorErrCode:6,
|
||||
SubErrCode:[212],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"过流",
|
||||
MajorErrCode:7,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"短路",
|
||||
MajorErrCode:8,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"未执行槽任务",
|
||||
MajorErrCode:9,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"槽任务参数错误",
|
||||
MajorErrCode:10,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"其他异常",
|
||||
MajorErrCode:20,
|
||||
SubErrCode:[255,208,209,210,211,212,213],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
],//需要根据返回参数进行判断]
|
||||
SubErrInfo:[
|
||||
//详细错误段
|
||||
@@ -477,4 +537,4 @@ ErrFac:[],
|
||||
},//需要通过指标判断
|
||||
],
|
||||
};
|
||||
var EW_Product_Names=["EJ01","EJ03","EJ04","EJ05","EJ06","EJ09","EJ10","EQ09"];
|
||||
var EW_Product_Names=["EW"];
|
@@ -350,28 +350,88 @@ JQ_ErrorInfo={
|
||||
//错误描述
|
||||
//主错误段
|
||||
MajorErrInfo:[
|
||||
{Info:"执行成功",MajorErrCode:0,SubErrCode:[]},
|
||||
{Info:"检测器异常",MajorErrCode:1,SubErrCode:[21,23,254]},
|
||||
{
|
||||
Info:"执行成功",
|
||||
MajorErrCode:0,
|
||||
SubErrCode:[],
|
||||
ErrFac:["未检测到异常"],
|
||||
},
|
||||
{
|
||||
Info:"检测器异常",
|
||||
MajorErrCode:1,
|
||||
SubErrCode:[21,23,254],
|
||||
ErrFac:["1.外部短路导致检测器调压失败","2.设备故障"],
|
||||
},
|
||||
// 主电容异常移除 dac比较错误30,状态错误42
|
||||
// 如果有电容异常,在充能阶段已经暴露
|
||||
{Info:"主电容异常",MajorErrCode:2,SubErrCode:[31,32,33,34,35]},
|
||||
{Info:"接触异常",MajorErrCode:3,SubErrCode:[27]},
|
||||
{
|
||||
Info:"主电容异常",
|
||||
MajorErrCode:2,
|
||||
SubErrCode:[31,32,33,34,35],
|
||||
ErrFac:["1.电容充放电测试指标超出限制","2.电容短路、短路或损坏"],
|
||||
},
|
||||
{
|
||||
Info:"接触异常",
|
||||
MajorErrCode:3,
|
||||
SubErrCode:[27],
|
||||
ErrFac:["1.线路接触异常","2.模块铆接异常","3.芯片虚焊或损坏"],
|
||||
},
|
||||
// 桥丝异常移除 41,42
|
||||
// 如果有桥丝异常,在dac比较阶段和电阻检阶段已暴露
|
||||
{Info:"桥丝阻值异常",MajorErrCode:4,SubErrCode:[30,51]},
|
||||
{
|
||||
Info:"桥丝阻值异常",
|
||||
MajorErrCode:4,
|
||||
SubErrCode:[30,51],
|
||||
ErrFac:["1.(外力导致)桥丝断","2.桥丝焊接异常"],
|
||||
},
|
||||
// 移除上电充能异常22,加入其他异常
|
||||
{Info:"芯片异常",MajorErrCode:5,SubErrCode:[24,25,26,27,28,29,30,32,33,35,36,37,38,39,40,41,42,43,44,45,52,53,54]},
|
||||
{Info:"判定任务缺失",MajorErrCode:6,SubErrCode:[212]},
|
||||
{Info:"过流",MajorErrCode:7,SubErrCode:[]},
|
||||
{Info:"短路",MajorErrCode:8,SubErrCode:[]},
|
||||
{Info:"未执行槽任务",MajorErrCode:9,SubErrCode:[]},
|
||||
{Info:"槽任务参数错误",MajorErrCode:10,SubErrCode:[]},
|
||||
{Info:"其他异常",MajorErrCode:20,SubErrCode:[22,255,208,209,210,211,212,213]},
|
||||
{
|
||||
Info:"芯片异常",
|
||||
MajorErrCode:5,
|
||||
SubErrCode:[24,25,26,27,28,29,30,32,33,35,36,37,38,39,40,41,42,43,44,45,52,53,54],
|
||||
ErrFac:["1.对芯片功能(读写OTP、时钟校准等)的检测失败"],
|
||||
},
|
||||
{
|
||||
Info:"判定任务缺失",
|
||||
MajorErrCode:6,
|
||||
SubErrCode:[212],
|
||||
ErrFac:["1.设备程序未更新"],
|
||||
},
|
||||
{
|
||||
Info:"过流",
|
||||
MajorErrCode:7,
|
||||
SubErrCode:[],
|
||||
ErrFac:["1.模块静态电流指标超过限制"],
|
||||
},
|
||||
{
|
||||
Info:"连接线短路",
|
||||
MajorErrCode:8,
|
||||
SubErrCode:[],
|
||||
ErrFac:["1.线路短路","2.芯片焊接异常","3.器件损坏"],
|
||||
},
|
||||
{
|
||||
Info:"未执行槽任务",
|
||||
MajorErrCode:9,
|
||||
SubErrCode:[],
|
||||
ErrFac:["1.设备程序未更新"],
|
||||
},
|
||||
{
|
||||
Info:"槽任务参数错误",
|
||||
MajorErrCode:10,
|
||||
SubErrCode:[],
|
||||
ErrFac:["1.槽任务(写延时、写流水号等)返回值错误"],
|
||||
},
|
||||
{
|
||||
Info:"其他异常",
|
||||
MajorErrCode:20,
|
||||
SubErrCode:[22,255,208,209,210,211,212,213],
|
||||
ErrFac:["1.不常见的异常"],
|
||||
},
|
||||
],//需要根据返回参数进行判断]
|
||||
SubErrInfo:[
|
||||
//详细错误段
|
||||
{Info:"无异常",ErrCode:0,
|
||||
ErrFac:["当检测任务不产生异常时使用此错误码"]},
|
||||
ErrFac:["1.当检测任务不产生异常时使用此错误码"]},
|
||||
{Info:"预设电压异常",ErrCode:21,
|
||||
ErrFac:["1.检测小板电压调节失效,存在无法设置的电压"]},
|
||||
{Info:"上电充能错误",ErrCode:22,
|
||||
@@ -487,4 +547,4 @@ ErrFac:[],
|
||||
},//需要通过指标判断
|
||||
],
|
||||
};
|
||||
var JQ_Product_Names=["EJ01","EJ03","EJ04","EJ05","EJ06","EJ09","EJ10","EQ09","EQ05","EQ06","EQ07"];
|
||||
var JQ_Product_Names=["EJ","EQ","EJ(Q)"];
|
@@ -305,17 +305,67 @@ XT_ErrorInfo={
|
||||
//错误描述
|
||||
//主错误段
|
||||
MajorErrInfo:[
|
||||
{Info:"执行成功",MajorErrCode:0,SubErrCode:[]},
|
||||
{
|
||||
Info:"执行成功",
|
||||
MajorErrCode:0,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
// 添加异常代码254
|
||||
{Info:"检测器异常",MajorErrCode:1,SubErrCode:[21,23,254]},
|
||||
{Info:"主电容异常",MajorErrCode:2,SubErrCode:[31,32,33,34,35]},
|
||||
{Info:"接触异常",MajorErrCode:3,SubErrCode:[27,37]},
|
||||
{Info:"桥丝阻值异常",MajorErrCode:4,SubErrCode:[30,51]},
|
||||
{Info:"芯片异常",MajorErrCode:5,SubErrCode:[22,24,25,26,27,28,29,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,54,55]},
|
||||
{Info:"判定任务缺失",MajorErrCode:6,SubErrCode:[212]},
|
||||
{Info:"过流",MajorErrCode:7,SubErrCode:[]},
|
||||
{Info:"短路",MajorErrCode:8,SubErrCode:[]},
|
||||
{Info:"其他异常",MajorErrCode:20,SubErrCode:[255,208,209,210,211,212,213]},
|
||||
{
|
||||
Info:"检测器异常",
|
||||
MajorErrCode:1,
|
||||
SubErrCode:[21,23,254],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"主电容异常",
|
||||
MajorErrCode:2,
|
||||
SubErrCode:[31,32,33,34,35],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"接触异常",
|
||||
MajorErrCode:3,
|
||||
SubErrCode:[27,37],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"桥丝阻值异常",
|
||||
MajorErrCode:4,
|
||||
SubErrCode:[30,51],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"芯片异常",
|
||||
MajorErrCode:5,
|
||||
SubErrCode:[22,24,25,26,27,28,29,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,54,55],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"判定任务缺失",
|
||||
MajorErrCode:6,
|
||||
SubErrCode:[212],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"过流",
|
||||
MajorErrCode:7,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"短路",
|
||||
MajorErrCode:8,
|
||||
SubErrCode:[],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
{
|
||||
Info:"其他异常",
|
||||
MajorErrCode:20,
|
||||
SubErrCode:[255,208,209,210,211,212,213],
|
||||
ErrFac:["参考错误细分项"],
|
||||
},
|
||||
],//需要根据返回参数进行判断]
|
||||
SubErrInfo:[
|
||||
//详细错误段
|
||||
@@ -447,6 +497,6 @@ ErrFac:[],
|
||||
}
|
||||
|
||||
|
||||
var XT_Product_Names=["EX05A","EX09C","EX09F","EX09J","EX09A"];
|
||||
var XT_Product_Names=["EX"];
|
||||
|
||||
|
||||
|
@@ -160,6 +160,7 @@ function Checker_PlanTest()
|
||||
var MesBox_InputTestResult_ID = -1;
|
||||
function CheckerShowMes_InputResult()
|
||||
{
|
||||
|
||||
if(MesBox_InputTestResult_ID < 0)
|
||||
{
|
||||
|
||||
@@ -382,23 +383,20 @@ function Checker_CommSendStr(str)
|
||||
|
||||
}
|
||||
|
||||
function Checker_ShowCurMontior()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
function Checker_ShowReadStr(str)
|
||||
{
|
||||
//str = "test taefCurM1ontiorofjiofjowfjoeifdslafjow\n"
|
||||
str = str.replace("\r\n","\n");
|
||||
str = str.replace("\r","\n");
|
||||
if(str.indexOf("CurMontior") >= 0)
|
||||
|
||||
if(str.indexOf("CurMR") >= 0)
|
||||
{
|
||||
CheckerShowCurEcharts(cur);
|
||||
str = str.split("\t");
|
||||
CheckerShowCurEcharts(str[1]);
|
||||
}
|
||||
else if(CheckerPlanTest_flag == false)
|
||||
{
|
||||
str = str.replace("\r\n","\n");
|
||||
str = str.replace("\r","\n");
|
||||
str = str.split("\n");
|
||||
for(var index = 0; index < str.length;index++)
|
||||
{
|
||||
|
@@ -8,11 +8,11 @@ var CheckerChipID = 0;
|
||||
var Checker_Product_Name = JQ_Product_Names;
|
||||
var epe_qthandle = null;
|
||||
var Checker_Test_CMD_ID_BEG = 200;//测试命令的起始ID应该大于200
|
||||
var ProductFun_Class = ["0:100uF大电解30um桥丝","1:68uF坦电容22um桥丝","2:68uF坦电容8Ω电阻","3:68uF坦电容6Ω电阻","4:33uF钽电容22um桥丝",
|
||||
"5:33uF钽电容2欧电阻","6:100uF固液混合","7:82uF电解8R电阻"]
|
||||
var ProductFun_Class = ["0:通用","1:68uF坦电容22um桥丝","2:68uF坦电容8Ω电阻","3:68uF坦电容6Ω电阻","4:33uF钽电容22um桥丝",
|
||||
"5:33uF钽电容2Ω电阻","6:100uF固液混合6欧","7:82uF电解8Ω电阻","8:100uF固液混合8Ω电阻","9:100uF大电解30um桥丝"]
|
||||
|
||||
var Checker_YE_Cfg = {
|
||||
PlanID:01,//检测方案ID
|
||||
PlanID:1,//检测方案ID
|
||||
PlanBrief:"电解电容雷管厂高压检测",
|
||||
CheckSoftVersion:[0x0001,0x0002],//适配检测小板,检测小板主版本
|
||||
CheckHardVersion:[0x000],//适配的硬件
|
||||
@@ -25,7 +25,7 @@ FacInfoAddr:-1,//小于0表示未选择
|
||||
FacFunClass:0,
|
||||
}
|
||||
|
||||
var CheckerChipType=["EJ系列","EX系列","EW系列"];
|
||||
var CheckerChipType=["EJ/EQ系列","EX系列","EW系列"];
|
||||
|
||||
function JQChecker_GetErrorInfo(errcode)
|
||||
{
|
||||
@@ -104,8 +104,7 @@ function CheckerPlan_Init()
|
||||
{
|
||||
console.log("JQCheckerPlan_Init OK ---");
|
||||
}else{
|
||||
// epe_qthandle = qchannel.objects.epe_qthandle;
|
||||
epe_qthandle=pywebview.api
|
||||
epe_qthandle = qchannel.objects.epe_qthandle;
|
||||
if ((typeof(epe_qthandle) != "undefined") && (epe_qthandle != null))
|
||||
{
|
||||
console.log("JQCheckerPlan_Init OK ---");
|
||||
@@ -260,11 +259,11 @@ function Checker_UpdateChipInfo(chipid)
|
||||
switch(chipid)
|
||||
{
|
||||
case 0:Checker_Error_Info = JQ_ErrorInfo;CheckerTask_Info = JQCheckerTaskInfo;
|
||||
Checker_Product_Name = JQ_Product_Names; break;
|
||||
Checker_Product_Name = JQ_Product_Names; break;
|
||||
case 1:Checker_Error_Info = XT_ErrorInfo;CheckerTask_Info = XTCheckerTaskInfo;
|
||||
Checker_Product_Name = XT_Product_Names;break;
|
||||
case 2:Checker_Error_Info = EW_ErrorInfo;CheckerTask_Info = EWCheckerTaskInfo;
|
||||
Checker_Product_Name = EW_Product_Names;break;
|
||||
Checker_Product_Name = XT_Product_Names;break;
|
||||
case 2:Checker_Error_Info = EW_ErrorInfo;CheckerTask_Info = EWCheckerTaskInfo;
|
||||
Checker_Product_Name = EW_Product_Names;break;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -526,14 +525,28 @@ function Checker_GetCfgInfo()
|
||||
retry_count = parseInt(retry_count,10);
|
||||
|
||||
var param_info = [];
|
||||
|
||||
|
||||
/*2023-11-20 修改遍历查找对应ID的配置信息*/
|
||||
var CheckerItem_Info ;
|
||||
for(var i = 0; i < CheckerTask_Info.length;i++)
|
||||
{
|
||||
if(CheckerTask_Info[i].TaskID == task_id)
|
||||
{
|
||||
CheckerItem_Info = CheckerTask_Info[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(param_array.length != 0 && task_id < Checker_Test_CMD_ID_BEG)//TaskID = 255 是独立测试命令
|
||||
{
|
||||
param_info = CheckerTask_Info[task_id].ParamInfo.slice(0,param_array.length);
|
||||
|
||||
param_info = CheckerItem_Info.ParamInfo.slice(0,param_array.length);
|
||||
}
|
||||
var rtv_info = [];
|
||||
// if(target_min.length != 0)
|
||||
// {
|
||||
// rtv_info = CheckerTask_Info[task_id].ReturnInfo.slice(0,target_min.length);
|
||||
// rtv_info = CheckerItem_Info.ReturnInfo.slice(0,target_min.length);
|
||||
// }
|
||||
|
||||
temp_input_list = temp_obj.find('.rtv_alias_input');
|
||||
@@ -602,35 +615,41 @@ function Checker_GetCfgInfo()
|
||||
|
||||
function Cheker_Export()
|
||||
{
|
||||
|
||||
Checker_Export_Plan = Checker_GetCfgInfo();
|
||||
// var json_str = JSON.stringify(Checker_Export_Plan);
|
||||
// console.log(json_str);
|
||||
|
||||
// if(!(epe_qthandle != null && typeof(epe_qthandle) != "undefined"))
|
||||
// {
|
||||
// var json_str = JSON.stringify(Checker_Export_Plan);
|
||||
// Checker_ExportMesInfo();
|
||||
// console.log(json_str);
|
||||
// return ;
|
||||
// }
|
||||
|
||||
if(Checker_Export_Plan.PlanID == (~0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Checker_ExportInputPWD();
|
||||
pywebview.api.save_plan(Checker_Export_Plan)
|
||||
}
|
||||
function Checker_Import()
|
||||
{
|
||||
if(epe_qthandle != null && typeof(epe_qthandle) != "undefined")
|
||||
{
|
||||
// console.log("ssssss")
|
||||
epe_qthandle.Epe_JQImportPlan();
|
||||
}else{
|
||||
var checker_plan = testPaln;
|
||||
// console.log(checker_plan)
|
||||
Checker_LoadPlan(checker_plan);
|
||||
}
|
||||
|
||||
// var checker_plan = testPaln;
|
||||
// Checker_LoadPlan(checker_plan);
|
||||
pywebview.api.load_plan().then((result)=>{
|
||||
if(result !=null){
|
||||
Checker_LoadPlan(result);
|
||||
}else{
|
||||
// Checker_LoadPlan(testPaln);
|
||||
}
|
||||
})
|
||||
}
|
||||
function Checker_LoadPlan(checker_plan)
|
||||
{
|
||||
if((checker_plan.PlanID & 0xFFFFFF00) == 0)
|
||||
{
|
||||
var date = new Date();
|
||||
date_str = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDay();
|
||||
date_str = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
|
||||
checker_plan.planid = Checker_GetPlanID(date_str,0,checker_plan.PlanID);
|
||||
}
|
||||
var plan_info = Checker_GetShowPlanID(checker_plan.PlanID);
|
||||
@@ -643,7 +662,7 @@ function Checker_LoadPlan(checker_plan)
|
||||
function Checker_ImportShow(checker_plan )
|
||||
{
|
||||
//var checker_plan = Checker_YE_Cfg;
|
||||
// console.log(checker_plan);
|
||||
console.log(checker_plan);
|
||||
var obj_list = $(".checker_cfig_div").children();
|
||||
//删除所有元素
|
||||
while(obj_list.length > 1)
|
||||
@@ -1353,6 +1372,120 @@ function Checker_ErrorChoice(btnobj)
|
||||
});
|
||||
}
|
||||
|
||||
function Checker_ExportMesInfo()
|
||||
{
|
||||
Checker_Export_Plan.MajorErrInfo = Checker_Error_Info.MajorErrInfo;
|
||||
Checker_Export_Plan.SubErrInfo = Checker_Error_Info.SubErrInfo;
|
||||
|
||||
var AllError
|
||||
var Cheker_Info = {
|
||||
AllTaskInfoArray:CheckerTask_Info,
|
||||
PlanTaskInfoArray:[],
|
||||
AllErrorInfoArray:[],
|
||||
PlanErroInfoArray:[],
|
||||
PlanStandardInfo:[],
|
||||
}
|
||||
//taskInfoArray = Checker_Export_Plan.TaskArray;
|
||||
var allErrorInfoArray=[];
|
||||
var planErroInfoArray = [];
|
||||
var count = 0;
|
||||
var major_count = 0;
|
||||
for(var i =0; i < Checker_Error_Info.MajorErrInfo.length;i++ )
|
||||
{
|
||||
var info_ = {};
|
||||
info_.ErrCode = Checker_Error_Info.MajorErrInfo[i].MajorErrCode;
|
||||
info_.Info = Checker_Error_Info.MajorErrInfo[i].Info;
|
||||
info_.ErrFac = Checker_Error_Info.MajorErrInfo[i].ErrFac;
|
||||
allErrorInfoArray[count++] = info_;
|
||||
}
|
||||
planErroInfoArray = allErrorInfoArray;//将主错误放在每次方案错误里面
|
||||
major_count = count;
|
||||
for(var i = 0; i < Checker_Error_Info.SubErrInfo.length;i++ )
|
||||
{
|
||||
allErrorInfoArray[count++] = Checker_Error_Info.SubErrInfo[i];
|
||||
}
|
||||
Cheker_Info.AllErrorInfoArray = allErrorInfoArray;
|
||||
|
||||
|
||||
var taskInfoArray = [];
|
||||
count = 0;
|
||||
for(var i = 0; i < Checker_Export_Plan.TaskArray.length; i++)
|
||||
{
|
||||
var taskid = Checker_Export_Plan.TaskArray[i].TaskID;
|
||||
var index_ = 0;
|
||||
var flag_ = 0;
|
||||
var taskMes = "";
|
||||
for(var index_ = 0; index_< Cheker_Info.AllTaskInfoArray.length;index_++)
|
||||
{
|
||||
if(Cheker_Info.AllTaskInfoArray[index_].TaskID == taskid)
|
||||
{
|
||||
flag_ = 1;
|
||||
taskMes = Cheker_Info.AllTaskInfoArray[index_].TaskBrief ;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if(flag_ == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var obj_ = Checker_Export_Plan.TaskArray[i];
|
||||
obj_.TaskMes = taskMes;
|
||||
taskInfoArray[count++] = obj_;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for(var i = 0; i < Checker_Export_Plan.TaskArray.length; i++)
|
||||
{
|
||||
var tempStandard = Checker_Export_Plan.TaskArray[i].TestStandard;
|
||||
var tempRetInfo = Checker_Export_Plan.TaskArray[i].ReturnInfo;
|
||||
var taskid = Checker_Export_Plan.TaskArray[i].TaskID;
|
||||
var index_ = 0;
|
||||
for(var index_ = 0; index_< tempStandard.length;index_++)
|
||||
{
|
||||
var obj_={
|
||||
RetName:tempRetInfo[index_],
|
||||
Max:tempStandard[index_].Max,
|
||||
Min:tempStandard[index_].Min,
|
||||
}
|
||||
Cheker_Info.PlanStandardInfo[count++] = obj_;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(var i = 0; i < Checker_Error_Info.SubErrInfo.length; i++)
|
||||
{
|
||||
var err_code = Checker_Error_Info.SubErrInfo[i].ErrCode;
|
||||
for(var index_ = 0; index_< Checker_Export_Plan.TaskArray.length;index_++)
|
||||
{
|
||||
if(err_code == Checker_Export_Plan.TaskArray[index_].ExecuteErrCode)
|
||||
{
|
||||
break;
|
||||
}
|
||||
var ResultErrCodeArray = Checker_Export_Plan.TaskArray[index_].ResultErrCode;
|
||||
for(var index2 = 0; index2 < ResultErrCodeArray.length; index2++)
|
||||
{
|
||||
if(ResultErrCodeArray[index2] == err_code)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
planErroInfoArray[planErroInfoArray.length] = Cheker_Info.AllErrorInfoArray[i];
|
||||
}
|
||||
|
||||
Cheker_Info.PlanTaskInfoArray = taskInfoArray;
|
||||
Cheker_Info.PlanErroInfoArray = planErroInfoArray;
|
||||
var checker_info_str = JSON.stringify(Cheker_Info,null,2);
|
||||
var json_str = JSON.stringify(Checker_Export_Plan,null,2);
|
||||
var pwd_str = $('.checker_export_pwd_input').val();
|
||||
if(epe_qthandle != null && typeof(epe_qthandle) != "undefined")
|
||||
{
|
||||
console.log("epe_qthandle.Epe_JQSavePlan");
|
||||
epe_qthandle.Epe_JQSavePlan2(pwd_str,CheckPlan_Export_PWD,Checker_Export_Plan.PlanBrief,json_str,checker_info_str);
|
||||
}
|
||||
|
||||
}
|
||||
function Checker_ExportInputPWD()
|
||||
{
|
||||
var content_str = '<div style="padding: 5px; min-width:30rem; line-height: 1.8rem; background-color: #393D49; color:#cdd4d3; ">';
|
||||
@@ -1383,99 +1516,8 @@ function Checker_ExportInputPWD()
|
||||
});
|
||||
Checker_Pwwd_Dialog_ID = tip_id;
|
||||
$(".jqchecker_export_pwd_btn").click(function(){
|
||||
Checker_Export_Plan.MajorErrInfo = Checker_Error_Info.MajorErrInfo;
|
||||
Checker_Export_Plan.SubErrInfo = Checker_Error_Info.SubErrInfo;
|
||||
var Cheker_Info = {
|
||||
AllTaskInfoArray:CheckerTask_Info,
|
||||
PlanTaskInfoArray:[],
|
||||
AllErrorInfoArray:Checker_Error_Info.SubErrInfo,
|
||||
PlanErroInfoArray:[],
|
||||
PlanStandardInfo:[],
|
||||
}
|
||||
//taskInfoArray = Checker_Export_Plan.TaskArray;
|
||||
|
||||
var taskInfoArray = [];
|
||||
var count = 0;
|
||||
for(var i = 0; i < Checker_Export_Plan.TaskArray.length; i++)
|
||||
{
|
||||
var taskid = Checker_Export_Plan.TaskArray[i].TaskID;
|
||||
var index_ = 0;
|
||||
var flag_ = 0;
|
||||
var taskMes = "";
|
||||
for(var index_ = 0; index_< Cheker_Info.AllTaskInfoArray.length;index_++)
|
||||
{
|
||||
if(Cheker_Info.AllTaskInfoArray[index_].TaskID == taskid)
|
||||
{
|
||||
flag_ = 1;
|
||||
taskMes = Cheker_Info.AllTaskInfoArray[index_].TaskBrief ;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if(flag_ == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var obj_ = Checker_Export_Plan.TaskArray[i];
|
||||
obj_.TaskMes = taskMes;
|
||||
taskInfoArray[count++] = obj_;
|
||||
}
|
||||
var count = 0;
|
||||
for(var i = 0; i < Checker_Export_Plan.TaskArray.length; i++)
|
||||
{
|
||||
var tempStandard = Checker_Export_Plan.TaskArray[i].TestStandard;
|
||||
var tempRetInfo = Checker_Export_Plan.TaskArray[i].ReturnInfo;
|
||||
var taskid = Checker_Export_Plan.TaskArray[i].TaskID;
|
||||
var index_ = 0;
|
||||
for(var index_ = 0; index_< tempStandard.length;index_++)
|
||||
{
|
||||
var obj_={
|
||||
RetName:tempRetInfo[index_],
|
||||
Max:tempStandard[index_].Max,
|
||||
Min:tempStandard[index_].Min,
|
||||
}
|
||||
Cheker_Info.PlanStandardInfo[count++] = obj_;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var planErroInfoArray = [];
|
||||
count = 0;
|
||||
for(var i = 0; i < Cheker_Info.AllErrorInfoArray.length; i++)
|
||||
{
|
||||
var taskid = Cheker_Info.AllErrorInfoArray[i].ErrCode;
|
||||
var flag_ = 0;
|
||||
for(var index_ = 0; index_< Checker_Export_Plan.TaskArray.length;index_++)
|
||||
{
|
||||
if(taskid == Checker_Export_Plan.TaskArray[index_].ExecuteErrCode)
|
||||
{
|
||||
flag_ = 1;
|
||||
break;
|
||||
}
|
||||
var ResultErrCodeArray = Checker_Export_Plan.TaskArray[index_].ResultErrCode;
|
||||
for(var index2 = 0; index2 < ResultErrCodeArray.length; index2++)
|
||||
{
|
||||
if(ResultErrCodeArray[index2] == taskid)
|
||||
{
|
||||
flag_ = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
planErroInfoArray[count++] = Cheker_Info.AllErrorInfoArray[i];
|
||||
}
|
||||
Cheker_Info.PlanTaskInfoArray = taskInfoArray;
|
||||
Cheker_Info.PlanErroInfoArray = planErroInfoArray;
|
||||
var checker_info_str = JSON.stringify(Cheker_Info,null,2);
|
||||
var json_str = JSON.stringify(Checker_Export_Plan,null,2);
|
||||
var pwd_str = $('.checker_export_pwd_input').val();
|
||||
if(epe_qthandle != null && typeof(epe_qthandle) != "undefined")
|
||||
{
|
||||
console.log("epe_qthandle.Epe_JQSavePlan");
|
||||
epe_qthandle.Epe_JQSavePlan(pwd_str,CheckPlan_Export_PWD,json_str,checker_info_str);
|
||||
}
|
||||
});
|
||||
Checker_ExportMesInfo();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -1505,4 +1547,66 @@ function Checker_AddTaskList()
|
||||
}
|
||||
|
||||
|
||||
function Checker_UpLoadServer()
|
||||
{
|
||||
Checker_Export_Plan = Checker_GetCfgInfo();
|
||||
if(Checker_Export_Plan.PlanID == (~0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var json_str = JSON.stringify(Checker_Export_Plan,null,2);
|
||||
$.ajax({
|
||||
url: 'http://47.108.119.117:9080/pjySource/upCheckplan',
|
||||
method: 'POST',
|
||||
data: json_str,
|
||||
success: function(response) {
|
||||
response = eval("(" + response+")");
|
||||
if(response.isOK == true)
|
||||
{
|
||||
console.log('请求成功:', response);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.log('请求失败:', error);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 选项改变之后
|
||||
function slect_onchange(){
|
||||
// 选择工厂
|
||||
var chip = document.getElementById("product_class_sel_id");
|
||||
var fatc = document.getElementById("plan_fatc_sel_id");
|
||||
var step = document.getElementById("plan_step_sel_id");
|
||||
var bref = document.getElementById("plan_bref_input");
|
||||
var featur = document.getElementById("plan_featur_sel_id");
|
||||
var date_input = document.getElementById("plan_date_id");
|
||||
var planid_input = document.getElementById("plan_id_input_id");
|
||||
var fatc_text = fatc.options[fatc.selectedIndex].text;
|
||||
var step_text = step.options[step.selectedIndex].text;
|
||||
var featur_text = featur.options[featur.selectedIndex].text;
|
||||
var chip_text= chip.options[chip.selectedIndex].text;
|
||||
var date_text=date_input.value.split("-");
|
||||
bref.value=chip_text+fatc_text+step_text+featur_text.split(":")[1]
|
||||
+date_text[1]+date_text[2]+'_'+planid_input.value;
|
||||
}
|
||||
|
||||
function date_click(){
|
||||
console.log("date_click");
|
||||
var date = new Date();
|
||||
var date_str = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
|
||||
var date_input = document.getElementById("plan_date_id");
|
||||
date_input.value=date_str;
|
||||
// 更新日期显示
|
||||
var plan_id=Checker_GetPlanIDInput();
|
||||
var planid_info=Checker_GetShowPlanID(plan_id);
|
||||
date_input.value=planid_info.date_str;
|
||||
|
||||
console.log(date_str);
|
||||
slect_onchange();
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<button type="button" class="layui-btn layui-btn-normal " style="height: 1.8rem; line-height: 1.8rem; padding: 0 0.8rem;width: 90%;" onclick="ep2_cmd(10)" >起爆</button>
|
||||
</div>
|
||||
<div class="layui-col-xs2">
|
||||
<button type="button" class="layui-btn layui-btn-normal " style="height: 1.8rem; line-height: 1.8rem; padding: 0 0.8rem;width: 90%;" onclick="ep2_cmd(11)" >更新</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal " style="height: 1.8rem; line-height: 1.8rem; padding: 0 0.8rem;width: 90%;" onclick="ep2_cmd(11)" >电容时间</button>
|
||||
</div>
|
||||
<div class="layui-col-xs2">
|
||||
<button type="button" class="layui-btn layui-btn-normal " style="height: 1.8rem; line-height: 1.8rem; padding: 0 0.8rem;width: 90%;padding: 0 3px;" onclick="ep2_cmd(12)" >复位地址</button>
|
||||
|
@@ -1181,8 +1181,8 @@ function YMUid_Valid_check(u8ArrayYMUid) {
|
||||
}
|
||||
}
|
||||
|
||||
if (u8ValidDataCounter < 7)
|
||||
return 1;
|
||||
if (u8ValidDataCounter < 7)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -64,10 +64,7 @@
|
||||
<div class="layui-row" style="height: 100% ;">
|
||||
<div class="layui-col-xs2 " style="height: 100% ; overflow-y: auto;" >
|
||||
<ul class="layui-nav layui-nav-tree " lay-filter="ul_checker_menu" style=" width: 95%; background-color: #747269;">
|
||||
<select class="product_chip_select" lay-verify="required" style="width: 100%;height: 1.8rem;line-height: 1.8rem;font-size: 16px; background-color: #efd9a8">
|
||||
<option value="1">EJ系列</option>
|
||||
<option value="2">EX系列</option>
|
||||
<option value="3">EW系列</option>
|
||||
<select id="product_chip_sel_id" class="product_chip_select" lay-verify="required" style="width: 100%;height: 1.8rem;line-height: 1.8rem;font-size: 16px; background-color: #efd9a8">
|
||||
</select>
|
||||
<!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
|
||||
<li class="layui-nav-item layui-nav-itemed checker_task_list" >
|
||||
@@ -97,20 +94,17 @@
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #efd9a8;" >方案ID:</div>
|
||||
</div>
|
||||
<div class="layui-col-xs1 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #efd9a8;" >日期</div>
|
||||
<div class="grid-demo grid-demo-bg1" onclick="date_click()" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #efd9a8;" >日期</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-xs2">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin:0 4px ;text-align: center;border-radius: 2px;" >
|
||||
<input type="text" value="" class="layui-input" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
<input id="plan_date_id" type="text" value="" class="layui-input" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-xs2 ">
|
||||
<select class="product_class_select" style="width: 80%;height: 1.8rem;line-height: 1.6rem;font-size: 16px;">
|
||||
<option value="1">EJ05</option>
|
||||
<option value="2">EJ06</option>
|
||||
<option value="3">EJ07</option>
|
||||
<select id="product_class_sel_id" onchange="slect_onchange()" class="product_class_select" style="width: 80%;height: 1.8rem;line-height: 1.6rem;font-size: 16px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-col-xs1 ">
|
||||
@@ -118,7 +112,7 @@
|
||||
</div>
|
||||
<div class="layui-col-xs1 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin:0 4px ;text-align: center;border-radius: 2px;" >
|
||||
<input type="text" value="" class="layui-input" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
<input id="plan_id_input_id" onchange="slect_onchange()" type="text" value="" class="layui-input" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -153,7 +147,7 @@
|
||||
</div>
|
||||
<div class="layui-col-xs8 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin:0 4px ;text-align: center;border-radius: 2px;" >
|
||||
<input type="text" value="" class="layui-input" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
<input id="plan_bref_input" type="text" value="" class="layui-input" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -187,29 +181,33 @@
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #efd9a8;" >工厂信息</div>
|
||||
</div>
|
||||
<div class="layui-col-xs1 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #eee;" >数据长度</div>
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #eee;" >厂家</div>
|
||||
</div>
|
||||
<div class="layui-col-xs2 ">
|
||||
<select id="plan_fatc_sel_id" onchange="slect_onchange()" class="plan_fatc_select" style="width: 80%;height: 1.8rem;line-height: 1.6rem;font-size: 16px;">
|
||||
<option value="1">代工厂</option>
|
||||
<option value="2">LG厂</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-col-xs1 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin:0 4px ;text-align: center;border-radius: 2px;" >
|
||||
<input type="text" value="" class="layui-input" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs1 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #eee;" >缓存地址</div>
|
||||
</div>
|
||||
<div class="layui-col-xs1 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin:0 4px ;text-align: center;border-radius: 2px;" >
|
||||
<input type="text" value="" class="layui-input " style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">
|
||||
</div>
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #eee;" >工段</div>
|
||||
</div>
|
||||
<div class="layui-col-xs2 ">
|
||||
<select id="plan_step_sel_id" onchange="slect_onchange()" class="plan_step_select" style="width: 80%;height: 1.8rem;line-height: 1.6rem;font-size: 16px;">
|
||||
<option value="1">半成品</option>
|
||||
<option value="2">保压</option>
|
||||
<option value="3">成品</option>
|
||||
<option value="4">低压</option>
|
||||
<option value="5">高压</option>
|
||||
<option value="6">注码</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-xs1 ">
|
||||
<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #eee;" >模组特性</div>
|
||||
</div>
|
||||
<div class="layui-col-xs4 ">
|
||||
<select class="func_class_select" style="width: 80%;height: 1.8rem;line-height: 1.6rem;font-size: 16px;margin-left: 2px;">
|
||||
<option value="1">EJ05</option>
|
||||
<option value="2">EJ06</option>
|
||||
<option value="3">EJ07</option>
|
||||
<select id="plan_featur_sel_id" onchange="slect_onchange()" class="func_class_select" style="width: 80%;height: 1.8rem;line-height: 1.6rem;font-size: 16px;margin-left: 2px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -226,6 +224,10 @@
|
||||
style=" max-width:6rem; height: 1.8rem; line-height: 1.8rem; padding: 0 0.8rem;width: 90%;margin:0 auto;" onclick="CheckerShowMes_InputResult()">数据检测</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-col-xs2 ">
|
||||
<button type="button" class="layui-btn layui-btn-normal"
|
||||
style=" max-width:6rem; height: 1.8rem; line-height: 1.8rem; padding: 0 0.8rem;width: 90%;margin:0 auto;" onclick="Checker_UpLoadServer()">上传方案</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
@@ -47,7 +47,8 @@ var ep2_excued_rtv;
|
||||
var ep2_cmd_excue_busy = 0
|
||||
var ep2_bus_cur = 0;
|
||||
var ep2_recive_buf = [];
|
||||
var EP2_CMM_RATE = 800;
|
||||
var EP2_CMM_RATE = 500;
|
||||
var ep2_log_write_flag = 0;
|
||||
function Ep2_Start_Comm()
|
||||
{
|
||||
console.log("Ep2_Start_Comm ");
|
||||
@@ -164,7 +165,13 @@ function Ep2_Init()
|
||||
var id = data.elem.id;
|
||||
if(id == "mes_save_log")
|
||||
{
|
||||
layer.tips('日志记录 '+ (this.checked ? 'true' : 'false'), data.othis)
|
||||
layer.tips('日志记录 '+ (this.checked ? 'true' : 'false'), data.othis);
|
||||
if(this.checked )
|
||||
{
|
||||
ep2_log_write_flag = 1;
|
||||
}else{
|
||||
ep2_log_write_flag = 0;
|
||||
}
|
||||
}
|
||||
// else if(id == "soft_enhace")
|
||||
// {
|
||||
@@ -243,7 +250,7 @@ function EP2_HeartBeat(frame_buf)
|
||||
bus_current = bus_current.toFixed(3);
|
||||
var mes = "高电平电压 "+bus_volate+"V 中电平"+bus_mvolate+"V 总线输出 "+bus_v+"V 总线电流 "+bus_current+"mA"
|
||||
ep2_bus_cur = bus_current;
|
||||
ShowCommMes(mes,MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes(mes,MesgType.MESG_TYPE_INFO,ep2_log_write_flag);
|
||||
}
|
||||
function EP2Comm_Recive(jsoninfo)
|
||||
{
|
||||
@@ -342,7 +349,7 @@ async function Ep2_WaitCmdExcu( cmd, time_out)
|
||||
if(ep2_excued_rtv != 0)
|
||||
{
|
||||
ShowCommMes("命令执行失败",MesgType.MESG_TYPE_ERROR);
|
||||
epro2_oper.cycle_test = 0;//停止循环测试
|
||||
// epro2_oper.cycle_test = 0;//停止循环测试
|
||||
//epro2_oper.cycle_runcount = 1;
|
||||
return 2;
|
||||
}
|
||||
@@ -501,14 +508,45 @@ async function Ep2_CheckSelfCmd(addr)
|
||||
case 4: param[0] = 0 ; break;
|
||||
case 5: param[0] = 1 ;break;
|
||||
case 6: param[0] = 2 ;break;
|
||||
|
||||
}
|
||||
var cmd_buf = Ep2_CmdData(addr,32,param,0,4,EP2_CMM_RATE);
|
||||
var cmd_buf = Ep2_CmdData(addr,32,param,0,4,EP2_CMM_RATE);
|
||||
|
||||
ep2_excuedcmd = 0;
|
||||
Ep2_SendCmd(cmd_buf);
|
||||
var rtv = await Ep2_WaitCmdExcu(epro2_oper.cmd,1000);
|
||||
return rtv;
|
||||
|
||||
}
|
||||
|
||||
async function Ep2_ReadCapChgT()
|
||||
{
|
||||
var param = [];
|
||||
param[0] = 8;
|
||||
var cmd_buf = Ep2_CmdData(epro2_oper.commaddr,32,param,5,4,EP2_CMM_RATE);
|
||||
ep2_excuedcmd = 0;
|
||||
Ep2_SendCmd(cmd_buf);
|
||||
var rtv = await Ep2_WaitCmdExcu(epro2_oper.cmd,1000);
|
||||
if(rtv == 0)
|
||||
{
|
||||
var read_buf = [];
|
||||
ArrayCopy(ep2_recive_buf,read_buf,10,4);
|
||||
var capT = read_buf[3];
|
||||
capT <<= 8;
|
||||
capT += read_buf[2];
|
||||
capT <<= 8;
|
||||
capT += read_buf[1];
|
||||
capT <<= 8;
|
||||
capT += read_buf[0];
|
||||
capT >>= 2;
|
||||
var mes ;
|
||||
mes = "地址 "+epro2_oper.commaddr +" 电容充电时间us "+ capT;
|
||||
ShowCommMes(mes,MesgType.MESG_TYPE_INFO);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function Ep2_ReadFirmwareCmd(addr)
|
||||
{
|
||||
var param = [];
|
||||
@@ -531,7 +569,7 @@ async function Ep2_ReadFirmwareCmd(addr)
|
||||
async function Ep2_ReadSysStatesCmd(addr)
|
||||
{
|
||||
var param = [];
|
||||
var cmd_buf = Ep2_CmdData(addr,28,param,5,2,EP2_CMM_RATE);
|
||||
var cmd_buf = Ep2_CmdData(addr,28,param,5,80,EP2_CMM_RATE);
|
||||
ep2_excuedcmd = 0;
|
||||
Ep2_SendCmd(cmd_buf);
|
||||
var rtv = await Ep2_WaitCmdExcu(epro2_oper.cmd,1000);
|
||||
@@ -757,6 +795,9 @@ async function Ep2_SaveFirInfo()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var Ep2_Inspect_OK = [];
|
||||
|
||||
async function Ep2_Inspect_Task(type)
|
||||
{
|
||||
var bgaddr = epro2_oper.cycle_bgaddr;
|
||||
@@ -784,6 +825,7 @@ async function Ep2_Inspect_Task(type)
|
||||
var mes = "巡检成功: ";
|
||||
for(var index = 0; index < rtd.ok_addr.length;index++)
|
||||
{
|
||||
Ep2_Inspect_OK[Ep2_Inspect_OK.length] = rtd.ok_addr[index];
|
||||
mes += rtd.ok_addr[index]+" ";
|
||||
}
|
||||
if(rtd.ok_addr.length > 0)
|
||||
@@ -838,19 +880,19 @@ async function Ep2_RunBootLoader()
|
||||
ShowCommMes("执行跳转成功",MesgType.MESG_TYPE_INFO);
|
||||
}
|
||||
}
|
||||
async function Ep2_autoSetAddr()
|
||||
async function Ep2_autoSetAddr(max_addr, addr_fac)
|
||||
{
|
||||
var param = [];
|
||||
param[0] = epro2_oper.cycle_endaddr & 0x0FF;
|
||||
param[1] = (epro2_oper.cycle_endaddr >> 8) & 0x0FF;
|
||||
param[2] = epro2_oper.auset_addr_fac & 0x0FF;
|
||||
param[3] = (epro2_oper.auset_addr_fac >> 8) & 0x0FF;
|
||||
param[0] = max_addr & 0x0FF;
|
||||
param[1] = (max_addr >> 8) & 0x0FF;
|
||||
param[2] = addr_fac & 0x0FF;
|
||||
param[3] = (addr_fac >> 8) & 0x0FF;
|
||||
var cmd_buf = Ep2_CmdData(0,39,param,0,0,EP2_CMM_RATE)
|
||||
ep2_excuedcmd = 0;
|
||||
Ep2_SendCmd(cmd_buf);
|
||||
var rtv = await Ep2_WaitCmdExcu(epro2_oper.cmd,1000);
|
||||
if(rtv == 0){
|
||||
ShowCommMes("设置自动分配地址因子成功 " + epro2_oper.auset_addr_fac + "最大地址 "+ epro2_oper.cycle_endaddr ,MesgType.MESG_TYPE_INFO);
|
||||
ShowCommMes("设置自动分配地址因子成功 " + addr_fac + "最大地址 "+ max_addr ,MesgType.MESG_TYPE_INFO);
|
||||
}
|
||||
return rtv;
|
||||
}
|
||||
@@ -876,7 +918,8 @@ async function Ep2_ReadUID()
|
||||
return 0;
|
||||
}else{
|
||||
|
||||
ShowCommMes("读取UID失败 ",MesgType.MESG_TYPE_ERROR);
|
||||
ShowCommMes("地址 "+epro2_oper.commaddr +" 读取UID失败 ",MesgType.MESG_TYPE_ERROR);
|
||||
rtv = -1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -885,7 +928,8 @@ async function Ep2_ReadUID()
|
||||
async function Ep2_WriteUID()
|
||||
{
|
||||
var uid_arr = Str2Bytes(epro2_oper.uid);
|
||||
uid_arr = UidCode_YM2JQ(uid_arr);
|
||||
//uid_arr = UidCode_YM2JQ(uid_arr);
|
||||
uid_arr = UidCode_YM2JQ_2(uid_arr);
|
||||
uid_arr[uid_arr.length]= Epj_CalcCrc8(uid_arr,uid_arr.length);
|
||||
var rtv = await Ep2_WriteMTPCmd(epro2_oper.commaddr,0,uid_arr.length,uid_arr);
|
||||
if(rtv != 0)
|
||||
@@ -1069,8 +1113,22 @@ async function Ep2_ReadDelay()
|
||||
}else{
|
||||
ShowCommMes("地址 "+epro2_oper.commaddr+" 读延时失败",MesgType.MESG_TYPE_ERROR);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
async function Ep2_UpdateAddr(newaddr)
|
||||
{
|
||||
var param = [];
|
||||
param[0] = newaddr & 0xFF;
|
||||
param[1] = (newaddr >> 8) & 0xFF;
|
||||
var cmd_buf = Ep2_CmdData(epro2_oper.commaddr,36,param,0,0,EP2_CMM_RATE);
|
||||
ep2_excuedcmd = 0;
|
||||
Ep2_SendCmd(cmd_buf);
|
||||
var rtv = await Ep2_WaitCmdExcu(epro2_oper.cmd,1000);
|
||||
if(rtv == 0)
|
||||
{
|
||||
ShowCommMes("地址 "+ epro2_oper.commaddr+" 更新成功",MesgType.MESG_TYPE_INFO);
|
||||
}else{
|
||||
ShowCommMes("地址 "+ epro2_oper.commaddr+" 更新成功",MesgType.MESG_TYPE_ERROR);
|
||||
}
|
||||
}
|
||||
async function Ep2_WriteDelay()
|
||||
{
|
||||
@@ -1175,6 +1233,8 @@ async function Ep2_WriteRuncfg()
|
||||
|
||||
async function Ep2_ExcueOperCmd()
|
||||
{
|
||||
|
||||
|
||||
var once_excue = 0;
|
||||
if(epro2_oper.cycle_test > 0)
|
||||
{
|
||||
@@ -1199,6 +1259,7 @@ async function Ep2_ExcueOperCmd()
|
||||
case 6 : await Ep2_CheckSelfCmd(0);break;
|
||||
case 7 : await Ep2_ClkAmend();break;
|
||||
case 9: await Ep2_Inspect_Task(0);break;
|
||||
case 11 : await Ep2_ReadCapChgT();break;
|
||||
case 13: await Ep2_HeartBeat_SW();break;
|
||||
case 15: await Ep2_BusSwitch(1); break;
|
||||
case 16: await Ep2_BusSwitch(0); break;
|
||||
@@ -1219,7 +1280,7 @@ async function Ep2_ExcueOperCmd()
|
||||
case 31: await Ep2_WritMTPTask();break;
|
||||
case 32: await Ep2_ReadSysStatesCmd(epro2_oper.commaddr);break;
|
||||
case 33: await Ep2_ReadAmend();break;
|
||||
case 35: await Ep2_autoSetAddr();break;
|
||||
case 35: await Ep2_autoSetAddr(epro2_oper.cycle_endaddr,epro2_oper.auset_addr_fac);break;
|
||||
case 36: await Ep2_ReadRuncfg();break;
|
||||
case 37: await Ep2_WriteRuncfg();break;
|
||||
case 38: await Ep2_CfgAck();break;
|
||||
|
1301
web/layui/epro2_cmd.js.jq
Normal file
1301
web/layui/epro2_cmd.js.jq
Normal file
File diff suppressed because it is too large
Load Diff
@@ -78,7 +78,7 @@ function Main_ShowCommport(json_str)
|
||||
content += ' </select></div></div>'
|
||||
content += '<div class="layui-form-item"><label class="layui-form-label" style = "width:60px;padding:5px 10px; text-align:left;">波特率</label> ';
|
||||
content += '<div class="layui-input-block"><select id="main_serial_baud" lay-verify="required" style = "width:100px;height:25px">';
|
||||
content +='<option value="0" class="layui-this" selected>115200</option> <option value="1">57600</option> <option value="1">9600</option> <option value="2">4800</option>';
|
||||
content +='<option value="0" class="layui-this" selected>115200</option> <option value="1">57600</option> <option value="1">9600</option> <option value="2">38400</option>';
|
||||
content += ' </select></div></div>'
|
||||
content += '<div class="layui-form-item"><label class="layui-form-label" style = "width:60px;padding:5px 10px;text-align:left;">校验</label>';
|
||||
content += '<div class="layui-input-block"><select id="main_serial_parity" lay-verify="required" style = "width:100px;height:25px">';
|
||||
|
@@ -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);
|
||||
}
|
76
web/layui/plugin/EWScanUID.js
Normal file
76
web/layui/plugin/EWScanUID.js
Normal file
@@ -0,0 +1,76 @@
|
||||
async function EWScanUID()
|
||||
{
|
||||
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;">';
|
||||
|
||||
content_str += '<div class="layui-col-xs2">'
|
||||
content_str += '<button type="button" class="layui-btn layui-btn-normal plugin_bind_test" style="height: 1.8rem; line-height: 1.8rem;width: 90%;" onclick="Ew_StartScanUid()">扫描</button>';
|
||||
content_str += '</div>'
|
||||
content_str += '<div class="layui-col-xs2 ">';
|
||||
content_str += '<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #eee;" >分配因子</div> </div>';
|
||||
|
||||
content_str += '<div class="layui-col-xs2">';
|
||||
content_str += '<div class="grid-demo grid-demo-bg1" style="margin:0 4px ;text-align: center;border-radius: 2px;" >';
|
||||
content_str += '<input type="text" value="" class="layui-input ewscan_auto_fac" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">';
|
||||
content_str += '</div></div>';
|
||||
|
||||
content_str += '<div class="layui-col-xs2 ">';
|
||||
content_str += '<div class="grid-demo grid-demo-bg1" style="margin-left: 3px;text-align: center;border-radius: 2px; background-color: #eee;" >最大地址</div> </div>';
|
||||
|
||||
content_str += '<div class="layui-col-xs2">';
|
||||
content_str += '<div class="grid-demo grid-demo-bg1" style="margin:0 4px ;text-align: center;border-radius: 2px;" >';
|
||||
content_str += '<input type="text" value="" class="layui-input ewscan_auto_maxaddr" style="height: 1.8rem; line-height: 1.8rem; padding-left:0px; text-align:left;">';
|
||||
content_str += '</div></div>';
|
||||
|
||||
content_str += '</div>'
|
||||
$("#Oper_View").append(content_str);
|
||||
}
|
||||
|
||||
async function Ew_StartScanUid()
|
||||
{
|
||||
var scan_uid_rtv = [];
|
||||
var max_addr = parseInt($(".ewscan_auto_maxaddr").val(),10);
|
||||
var auto_fac = parseInt($(".ewscan_auto_fac").val(),10);
|
||||
ShowCommMes("启动搜索 最大个数 "+max_addr +" 随机值 "+ auto_fac ,MesgType.MESG_TYPE_INFO);
|
||||
epro2_oper.cmd = 35;
|
||||
await Ep2_autoSetAddr(max_addr,auto_fac);
|
||||
await TransSleep(200);
|
||||
epro2_oper.cmd = 9;
|
||||
epro2_oper.cycle_bgaddr = 21;
|
||||
epro2_oper.cycle_endaddr = max_addr+21;
|
||||
epro2_oper.cycle_group_count = 100;
|
||||
epro2_oper.sys_states ="80 00";
|
||||
Ep2_Inspect_OK = [];
|
||||
await Ep2_Inspect_Task(0);
|
||||
if(Ep2_Inspect_OK.length == 0)
|
||||
{
|
||||
ShowCommMes("搜索结束。。。。。。。。",MesgType.MESG_TYPE_INFO);
|
||||
return ;
|
||||
}
|
||||
await TransSleep(2000);
|
||||
var rtv = 0;
|
||||
for(var i = 0; i < Ep2_Inspect_OK.length; i++)
|
||||
{
|
||||
epro2_oper.cmd = 19;
|
||||
epro2_oper.commaddr = Ep2_Inspect_OK[i];
|
||||
rtv = await Ep2_ReadUID();
|
||||
if(rtv != 0)
|
||||
{
|
||||
await TransSleep(50);
|
||||
continue;
|
||||
|
||||
}
|
||||
scan_uid_rtv[scan_uid_rtv.length] = epro2_oper.uid;
|
||||
epro2_oper.cmd = 100;
|
||||
await Ep2_UpdateAddr(max_addr+50);
|
||||
await TransSleep(50);
|
||||
}
|
||||
for(var i = 0; i < scan_uid_rtv.length; i++)
|
||||
{
|
||||
ShowCommMes("UID: "+ scan_uid_rtv[i],MesgType.MESG_TYPE_INFO);
|
||||
}
|
||||
ShowCommMes("成功搜索 "+scan_uid_rtv.length+" 个UID",MesgType.MESG_TYPE_INFO);
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ async function fac_bind()
|
||||
epro2_oper.cmd = 13;
|
||||
await Ep2_HeartBeat_SW();
|
||||
ShowCommMes("注码脚本运行启动 fac_bind_run = "+fac_bind_run,MesgType.MESG_TYPE_INFO);
|
||||
var flow_str = epro2_oper.uid.slice(11,15);
|
||||
var flow_str = epro2_oper.uid.slice(12,16);
|
||||
var flow_num = parseInt(flow_str,10);
|
||||
var rtv = 0;
|
||||
while(fac_bind_run > 0)
|
||||
@@ -54,7 +54,7 @@ async function fac_bind()
|
||||
await Ep2_EnMTPWrite(1);
|
||||
await TransSleep(300);
|
||||
var last_uid = epro2_oper.uid;
|
||||
var uidhead = epro2_oper.uid.slice(0,11);
|
||||
var uidhead = epro2_oper.uid.slice(0,12);
|
||||
epro2_oper.uid = uidhead + IntFormat(4,flow_num);
|
||||
epro2_oper.cmd = 20;
|
||||
await Ep2_WriteUID();
|
||||
|
29
web/myweb.py
29
web/myweb.py
@@ -5,19 +5,30 @@ import json
|
||||
|
||||
|
||||
class Api:
|
||||
def button_click(self):
|
||||
print("button click.")
|
||||
path=os.path.split(os.path.abspath(sys.argv[0]))[0]
|
||||
print(path)
|
||||
result = wnd.create_file_dialog(dialog_type=wb.FOLDER_DIALOG,directory=path)
|
||||
print(result)
|
||||
return result[0] if result else ''
|
||||
|
||||
def save_plan(slef,plan:str):
|
||||
def __init__(self) -> None:
|
||||
self.path=os.path.split(os.path.abspath(sys.argv[0]))[0]
|
||||
|
||||
def load_plan(self):
|
||||
print("button click.")
|
||||
print(self.path)
|
||||
result = wnd.create_file_dialog(dialog_type=wb.OPEN_DIALOG,directory=self.path,
|
||||
file_types=('JSON (*.json)', 'All files (*.*)'))
|
||||
print(result)
|
||||
if(result is None):
|
||||
return None
|
||||
if(len(result)>0):
|
||||
with open(result[0],encoding="utf-8") as f:
|
||||
return json.loads(f.read())
|
||||
return None
|
||||
|
||||
def save_plan(slef,plan:dict):
|
||||
path=os.path.split(os.path.abspath(sys.argv[0]))[0]
|
||||
file_name=wnd.create_file_dialog(dialog_type=wb.SAVE_DIALOG,directory=path,save_filename="默认方案",
|
||||
file_name=wnd.create_file_dialog(dialog_type=wb.SAVE_DIALOG,directory=path,save_filename=plan["PlanBrief"],
|
||||
file_types=('JSON (*.json)', 'All files (*.*)'))
|
||||
print(file_name)
|
||||
if(file_name is None):
|
||||
return
|
||||
json_str=json.dumps(plan, sort_keys=True, indent=4, separators=(',', ': '),ensure_ascii=False)
|
||||
with open(file_name,"w+",encoding="utf-8") as f:
|
||||
f.write(json_str)
|
||||
|
Reference in New Issue
Block a user