| | |
| | | public String rtuAddr ; //控制器地址 |
| | | public Integer rate ; //进度 |
| | | public String state; //升级状态 |
| | | public Integer status; //过程状态(0:离线,1:升级中,2:升级成功,3升级失败) |
| | | public Integer reTryTimes ; //重试次数 |
| | | public Boolean over ; //是否结束(true:是,false:否) |
| | | public Boolean success ; //是否成功(true:是,false:否) |
| | | public Boolean success ; //是否成功(null:进行中,true:是,false:否) |
| | | |
| | | public void fromCache(UpgradeRtu ugRtu){ |
| | | this.rtuAddr = ugRtu.rtuAddr ; |
| | | this.rate = (ugRtu.currentPackage * 1000)/ugRtu.totalPackage ;//前端实现是1000份的进度条 |
| | | this.state = UpgradeRtu.getStateName(ugRtu.state) ; |
| | | this.status = 1 ;//默认升级中 |
| | | if(ugRtu.state == UpgradeRtu.STATE_OFFLINE){ |
| | | this.status = 0 ; |
| | | }else if(ugRtu.state == UpgradeRtu.STATE_SUCCESS){ |
| | | this.status = 2 ; |
| | | }else { |
| | | if(ugRtu.isOver && ugRtu.state != UpgradeRtu.STATE_SUCCESS){ |
| | | this.status = 3; |
| | | } |
| | | } |
| | | this.reTryTimes = ugRtu.reTryTimes ; |
| | | this.over = ugRtu.isOver ; |
| | | if(ugRtu.isOver){ |