| | |
| | |
|
| | | private double sysversion; //系统版本(0.1)
|
| | | private int sysstate; //系统状态 0-常规模式 1-内阻模式 2-编址模式
|
| | | private double groupvol; //组端电压(0.1)
|
| | | private double groupcurr; //组端电流(0.1)
|
| | | private float groupvol; //组端电压(0.1)
|
| | | private float groupcurr; //组端电流(0.1)
|
| | | public int battstate; //电池状态 0-浮充 1-放电 2-充电
|
| | | private int currdirection; //电流方向 0-充电 1-放电
|
| | |
|
| | |
| | | this.backup7 = state.backup7;
|
| | | this.backup8 = state.backup8;
|
| | | this.restestcount = state.restestcount; //内阻测试次数
|
| | |
|
| | | this.groupvol = groupvol+(float)Math.random()*10; //随机组端电压
|
| | | this.groupvol = (float)Math.round(groupvol*100)/100;
|
| | | this.groupcurr = groupcurr+(float)Math.random()*5; //随机组端电流
|
| | | this.groupcurr = (float)Math.round(groupcurr*100)/100;
|
| | | }
|
| | |
|
| | | //复制单体电压
|
| | |
| | |
|
| | | sysversion = ComBase.changeShortToDouble(tmpbuf.getShort())/10; //系统版本
|
| | | sysstate = ComBase.changeShortToInt(tmpbuf.getShort()); //系统状态
|
| | | groupvol = ComBase.changeShortToDouble(tmpbuf.getShort())/10; //组端电压
|
| | | groupcurr = ComBase.changeShortToDouble(tmpbuf.getShort())/10; //组端电流
|
| | | groupvol = (float)ComBase.changeShortToDouble(tmpbuf.getShort())/10; //组端电压
|
| | | groupcurr = (float)ComBase.changeShortToDouble(tmpbuf.getShort())/10; //组端电流
|
| | | battstate = ComBase.changeShortToInt(tmpbuf.getShort()); //电池状态
|
| | | currdirection = ComBase.changeShortToInt(tmpbuf.getShort()); //电流方向
|
| | | this.currdirection=1;
|
| | | this.battstate = 1;
|
| | | this.currdirection=0;
|
| | | this.battstate = 2;
|
| | | if(currdirection == 1){
|
| | | groupcurr = groupcurr *(-1); //改变当前电流方向
|
| | | }
|
| | |
| | | this.sysstate = sysstate;
|
| | | }
|
| | |
|
| | | public void setGroupvol(double groupvol) {
|
| | | public void setGroupvol(float groupvol) {
|
| | | this.groupvol = groupvol;
|
| | | }
|
| | |
|
| | | public void setGroupcurr(double groupcurr) {
|
| | | public void setGroupcurr(float groupcurr) {
|
| | | this.groupcurr = groupcurr;
|
| | | }
|
| | |
|