| | |
| | | if(taskVo.softStartAddr == null || taskVo.softStartAddr.trim().length() != 8){ |
| | | throw new Exception("程序覆盖起始地址不合法,必须是8字符(十六进制)的字符串") ; |
| | | } |
| | | if(taskVo.softFileData == null || taskVo.softFileData.length <= 0){ |
| | | if(taskVo.softFileData64 == null || taskVo.softFileData64.trim().length() == 0){ |
| | | throw new Exception("升级程序内容必须提供") ; |
| | | } |
| | | if(taskVo.softBytesCalculate == null){ |
| | |
| | | this.taskVo = taskVo ; |
| | | |
| | | this.upgradeRtus = new HashMap<>(); |
| | | if(taskVo.softFileData != null && taskVo.softFileData.length >0){ |
| | | if(taskVo.softFileData64 != null && taskVo.softFileData64.trim().equals("")){ |
| | | taskVo.softFileData = Base64.getDecoder().decode(taskVo.softFileData64); |
| | | List<byte[]> listBytes = new HexFileParse().splitBytesByUnit512(taskVo.softFileData); |
| | | this.softFileDataGrp = listBytes.toArray(new byte[0][]); |
| | | for(String rtuAddr : this.taskVo.rtuAddrList){ |
| | |
| | | * 强制结束升级任务 |
| | | */ |
| | | public void forceOver(){ |
| | | this.taskIsOver = true ;//强制设置任务完成 |
| | | this.taskOverType = TaskOverType_Force ;//任务完成方式(自然,强制) |
| | | this.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//任务完成时间(yyyy-mm-dd HH:MM:SS) |
| | | //this.taskVo.rtuAddrList.clear(); |
| | | //this.upgradeState.clear(); |
| | | if(!this.taskIsOver){ |
| | | this.taskIsOver = true ;//强制设置任务完成 |
| | | this.taskOverType = TaskOverType_Force ;//任务完成方式(自然,强制) |
| | | this.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//任务完成时间(yyyy-mm-dd HH:MM:SS) |
| | | //this.taskVo.rtuAddrList.clear(); |
| | | //this.upgradeState.clear(); |
| | | } |
| | | } |
| | | |
| | | /** |